“NLP generuje parse drzewo w Pythonie” Kod odpowiedzi

NLP generuje parse drzewo w Pythonie

from nltk.data import find
from bllipparser import RerankingParser

model_dir = find('models/bllip_wsj_no_aux').path
parser = RerankingParser.from_unified_model_dir(model_dir)

best = parser.parse("John is writing a letter with his pen in my room")

print(best.get_reranker_best())
print(best.get_parser_best())
Sparkling Stag

NLP generuje parse drzewo w Pythonie

from nltk.data import find
from bllipparser import RerankingParser

model_dir = find('models/bllip_wsj_no_aux').path
parser = RerankingParser.from_unified_model_dir(model_dir)

best = parser.parse("The old oak tree from India fell down.")

print(best.get_reranker_best())
print(best.get_parser_best())
Cute Cheetah

NLP generuje parse drzewo w Pythonie

from nltk.data import find
from bllipparser import RerankingParser

model_dir = find('models/bllip_wsj_no_aux').path
parser = RerankingParser.from_unified_model_dir(model_dir)

best = parser.parse("John is writing a letter with his pen in my room")

print(best.get_reranker_best())
print(best.get_parser_best())
Sparkling Stag

NLP generuje parse drzewo w Pythonie

 President Donald Trump and First Lady Melania Trump have tested positive for Covid-19.
Talented Turtle

NLP generuje parse drzewo w Pythonie

sudo python3 -m nltk.downloader bllip_wsj_no_aux
pip3 install bllipparser
Cute Cheetah

NLP generuje parse drzewo w Pythonie

-80.435259246021 -23.831876011253 (S1 (S (NP (NP (DT The) (JJ old) (NN oak) (NN tree)) (PP (IN from) (NP (NNP India)))) (VP (VBD fell) (PRT (RP down))) (. .)))
-79.703612178593 -24.505514522222 (S1 (S (NP (NP (DT The) (JJ old) (NN oak) (NN tree)) (PP (IN from) (NP (NNP India)))) (VP (VBD fell) (ADVP (RB down))) (. .)))
Cute Cheetah

Odpowiedzi podobne do “NLP generuje parse drzewo w Pythonie”

Pytania podobne do “NLP generuje parse drzewo w Pythonie”

Więcej pokrewnych odpowiedzi na “NLP generuje parse drzewo w Pythonie” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu