Skip to content

Commit

Permalink
Update scripts to do model eval to only consider token when upos is V…
Browse files Browse the repository at this point in the history
…ERB or AUX
  • Loading branch information
SecroLoL committed Oct 27, 2023
1 parent 84ee24d commit cd12480
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stanza/models/lemma_classifier/evaluate_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def evaluate_models(eval_path: str, binary_classifier: Any, baseline_classifier:
gold_doc = load_doc_from_conll_file(eval_path)
for sentence in doc.sentences:
for word in sentence.words:
if word.text == "'s" and word.upos == "VERB":
if word.text == "'s" and word.upos in ["VERB", "AUX"]:
gold_tag = word.lemma
# predict binary classifier
bin_predict = None # TODO
Expand All @@ -44,12 +44,12 @@ def main():
"""
Runs a test on the EN_GUM test set
"""
coNLL_path = os.path.join(os.path.dirname(__file__), "en_gum-ud-test.conllu")
coNLL_path = os.path.join(os.path.dirname(__file__), "en_gum-ud-train.conllu")
doc = load_doc_from_conll_file(coNLL_path)
count = 0
for sentence in doc.sentences:
for word in sentence.words:
if word.text == "'s" and word.upos == "VERB":
if word.text == "'s" and word.upos in ["VERB", "AUX"]:
print("Found")
print(word)
count += 1
Expand Down

0 comments on commit cd12480

Please sign in to comment.