stathwang / POS-Taggers

Part-of-Speech Tagging Models in Python
https://stathwang.github.io/part-of-speech-tagging-with-trigram-hidden-markov-models-and-the-viterbi-algorithm.html
MIT License
15 stars 5 forks source link

part-of-speech tags are abbreviation #1

Open niranjan8129 opened 6 years ago

niranjan8129 commented 6 years ago

Thanks for your very well tutorial, Suppose the word like " I need 100 dollar to buy a iphone .. .......What is the part-of-speech tags are abbreviation of 100 ? Also like 2nd example :" My account is number is ABC123XT What is the part-of-speech tags are abbreviation of ABC123XT ?

Can you please help me out how to implement on your code?

Also, can you please give node what is the execution steps ?

I get error while running below model

(base) C:\Users\nbehera4\Desktop\AI\POS-Taggers\model>python pos.py

Traceback (most recent call last): File "pos.py", line 315, in main() File "pos.py", line 277, in main unigram_p, bigram_p, trigram_p, trigram_d = calc_ngram_probs(brown_tags, unigram_c, bigram_c, trigram_c) File "pos.py", line 82, in calc_ngram_probs unigram_p = {(a,): math.log(unigram_c[(a,)], 2) - math.log(unigram_total, 2) for a in unigram_c} File "pos.py", line 82, in unigram_p = {(a,): math.log(unigram_c[(a,)], 2) - math.log(unigram_total, 2) for a in unigram_c} ValueError: math domain error

cyzanfar commented 5 years ago

this repo's code doesn't work unfortunately