MCPcopy Create free account
hub / github.com/google-research/language / simplify

Function simplify

language/labs/drkit/evaluate.py:527–535  ·  view source on GitHub ↗

Pre-process answer string.

(answer)

Source from the content-addressed store, hash-verified

525
526
527def simplify(answer):
528 """Pre-process answer string."""
529 toks = []
530 articles = {"the", "a", "an", "and", ""}
531 for t in answer.strip().lower().split():
532 tok = strip_accents_and_punct(t)
533 if tok not in articles:
534 toks.append(tok)
535 return "".join(toks)
536
537
538def rare_relation_scores(relationwise, relation2counts):

Callers 1

scoreFunction · 0.85

Calls 2

strip_accents_and_punctFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…