7,081 questions
1
vote
0
answers
62
views
nltk.FreqDist.plot fails to display plot
I'm trying in vain to make NLTK show a Frequency Distribution Plot using FreqDist.plot(). I've followed the steps from the first chapter of the NLTK book (scroll down to "3.1 Frequency ...
0
votes
1
answer
393
views
Python NLTK: LookupError for 'averaged_perceptron_tagger_eng' after download
I'm attempting to perform Part-of-Speech (POS) tagging in a Jupyter Notebook using the NLTK package. The averaged_perceptron_tagger resource cannot be located, according to the LookupError I keep ...
3
votes
1
answer
99
views
Python text tokenize code to output results from horizontal to vertical with grammar recognition
Below code tokenises the text and identifies the grammar of each tokenised word.
import nltk
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.corpus import wordnet as wn
#nltk....
0
votes
1
answer
91
views
How to set Python path for NLTK in Palantir Foundry Python Transform in Code Workbook
I am attempting to create a Python transform that requires me to import nltk. When I import nltk, later on I get:
Resource [93mpunkt_tab[0m not found.
Please use the NLTK Downloader to obtain the ...
0
votes
1
answer
41
views
nltk.NaiveBayesClassifier.classify() input parameter
I have the following trained classifier:
classifier = nltk.NaiveBayesClassifier.train(features[:train_count])
When I try to use it to classify():
result = classifier.classify(feature)
and feature is ...
0
votes
2
answers
207
views
Fixing Missing NLTK Tokenizer Resources
Repeated Lookup error eventhough NLTK is downloaded:
Resource [93mpunkt_tab[0m not found.
Please use the NLTK Downloader to obtain the resource:
31m>>> import nltk
nltk.download('...
0
votes
1
answer
118
views
Download data models while installing my python library
Sometimes, a Python library depends on additional data, such as ML models. This could be a model from transformers, spacy, nltkand so on. Typically there is a command to download such a model:
python -...
1
vote
1
answer
93
views
How do I remove escape characters from output of nltk.word_tokenize?
How do I get rid of non-printing (escaped) characters from the output of the nltk.word_tokenize method? I am working through the book 'Natural Language Processing with Python' and am following the ...
0
votes
0
answers
61
views
PunktTokenizer does not work with Russian `я.`
When tokenizing paragraphs to sentences in the Russian language, I am observing the special case when the sequence is not treated as the end of the sentence. The case is with the я. at the end of the ...
0
votes
0
answers
49
views
nltk add or remove some abbreviations for the specific project not working
When tokenizing paragraphs in the Czech language, I am observing that some abbreviations are not treated as abbreviations. The paragraph is stored in the file as one long line. The nltk is of the ...
1
vote
0
answers
34
views
I am getting error while running this line of code gnb.fit(df_train, y_train)
Title: ValueError: could not convert string to float when training GaussianNB for SMS Spam Detection
Body:
I'm building an SMS spam detection tool and encountering an error while predicting with a ...
-1
votes
2
answers
2k
views
Why am I getting a LookupError: Resource punkt_tab not found in NLTK even after downloading punkt?
I’m trying to perform Named Entity Recognition (NER) using NLTK, SpaCy, and a dataset in PyCharm. However, I’m encountering an error related to a missing resource (punkt_tab) when tokenizing text. ...
0
votes
0
answers
190
views
Issues with nltk's ne_chunk
I have been trying to use nltk's entity chunker, and tried different approaches but I keep getting the error:
LookupError Traceback (most recent call last)
...
...
0
votes
1
answer
64
views
Unable to install nltk
I have installed nltk through cmd on my windows 10 but when I try to import it in IDLE it does not work. Can someone please help? [This is the image of the installationThis is the image of the error ...
2
votes
2
answers
117
views
Is n-gram precision the number of elements in the intersection of one hypothesis and possibly many references?
I was trying to understand how BLEU score works and noticed that if I had to compute the n-gram precisions and have multiple reference sentences, it makes more sense to turn everything into sets to ...