diff --git a/evaluate.py b/evaluate.py index 2ac9654..c79fbce 100644 --- a/evaluate.py +++ b/evaluate.py @@ -20,14 +20,17 @@ for file_name in os.listdir('data'): for row in data: rows += 1 sentence = row[1] - for grammar in grammars: - match = grammar.find_matching_rules(sentence) - if match: - acts = row[2].split('&') - for act in acts: - user_act = re.search(PATTERN, act).group() - if user_act == grammar.name: - hits += 1 + sentences = sentence.split(',') + for sentence in sentences: + for grammar in grammars: + match = grammar.find_matching_rules(sentence) + if match: + acts = row[2].split('&') + for act in acts: + user_act = re.search(PATTERN, act).group() + if user_act == grammar.name: + print(grammar.name) + hits += 1 print(f"Accuracy: {(hits / rows)*100}") -# Dokładność 30% \ No newline at end of file +# Dokładność 44.6% \ No newline at end of file