new evaluate
This commit is contained in:
parent
be71442103
commit
c852703065
21
evaluate.py
21
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%
|
||||
# Dokładność 44.6%
|
Loading…
Reference in New Issue
Block a user