diff --git a/astro-ner/v1/find-astro.py b/astro-ner/v1/find-astro.py index 6388ff3..18ef528 100755 --- a/astro-ner/v1/find-astro.py +++ b/astro-ner/v1/find-astro.py @@ -10,12 +10,6 @@ logging.getLogger("flair").handlers[0].stream = sys.stderr - -def data_normalization(sentence): - cpy_sentence = sentence.lower() - return cpy_sentence - - tagger = SequenceTagger.load("v1/model.pt") for line in sys.stdin: @@ -37,9 +31,8 @@ SN = [] XPL = [] SR = [] - sent = data_normalization(text) - sentS = sent.split(".") - sentences = [Sentence(sentS[i] + ".") for i in range(len(sentS))] + sent = text.split(".") + sentences = [Sentence(sent[i] + ".") for i in range(len(sent))] tagger.predict(sentences) label_lists = { "PL": PL, @@ -83,7 +76,7 @@ unidecode("exoplanètes"): XPL, "sursaut radio, source radio, autres sursauts": SR, } - # ajouter unidecode + data["value"] = {id: value for id, value in returnDic.items() if value != []} sys.stdout.write(json.dumps(data)) sys.stdout.write("\n")