MCPcopy Create free account
hub / github.com/InternScience/InternAgent / simple_tokenize

Function simple_tokenize

tasks/AutoMem/code/utils.py:34–38  ·  view source on GitHub ↗

Simple tokenization function.

(text)

Source from the content-addressed store, hash-verified

32 sentence_model = None
33
34def simple_tokenize(text):
35 """Simple tokenization function."""
36 # Convert to string if not already
37 text = str(text)
38 return text.lower().replace('.', ' ').replace(',', ' ').replace('!', ' ').replace('?', ' ').split()
39
40def calculate_rouge_scores(prediction: str, reference: str) -> Dict[str, float]:
41 """Calculate ROUGE scores for prediction against reference."""

Callers 1

calculate_metricsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected