Quantcast
Channel: Active questions tagged nltk - Stack Overflow
Browsing latest articles
Browse All 82 View Live

How do I randomize responses?

I am using NLTK to create a chatbot in Python but I am considering rewriting it for spaCy. I am looking for a way to feed my AI several pre-built sentences to choose from at random from the pairs when...

View Article



removing paywall language from piece of text (pandas)

I'm trying to do some preprocessing on my dataset. Specifically, I'm trying to remove paywall language from the text (in bold below) but I keep getting an empty string as my output.Here is the sample...

View Article

Setting up nltk data from github repo

I was following nltk book chapter 1. I am able to install nltk (import nltk) but was not able to download the book corpus by running nltk.download(). It gave me getattrinfo failed error. So I started...

View Article

How I get precision, recall, and f1-score from nltk.naivebayesclassifier?

I have a text classification problem with 3 target variables and I'm running a separate nltk.naivebayesclassifier for each. I have a function that trains, tests, and evaluates the training and testing...

View Article

Parsing city of origin / destination city from a string

I have a pandas dataframe where one column is a bunch of strings with certain travel details. My goal is to parse each string to extract the city of origin and destination city (I would like to...

View Article


python project - required packages won't install in pych

currently im bulinding resume analyzer application which is based on python,streamlit, xampp,and nlpI'm getting the error in the terminal -OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't...

View Article

Problems with training a model with pytorch

I am trying to train a model on pytorch and it is giving me the following error:RuntimeError: element 0 of tensors does not require grad and does not have a grad_fnIt seems that the trainer has trouble...

View Article

NameError: name 'sense2vec_instance' is not defined

after I ran my model "NameError: name 'sense2vec_instance' is not defined" this error appeared.In this model, I was expected to generate questions after uploading a pdf. while trying to fix the error I...

View Article


How can i get the first content of a python synsets list?

enter image description hereI have a scrapped text stored under the variable "message".I have removed the StopWords and stored the result with the variable "without_stop_words".I want to loop through...

View Article


Image may be NSFW.
Clik here to view.

NLTK wordnet not found

I'm learning nlp with NLTK and one step is using WordNetLemmatizer, so i've downloaded it. But it says wordnet was not found when i run my code.Console (Error)PS C:\Users\renat\Downloads\myapp>...

View Article

Image may be NSFW.
Clik here to view.

Comparison between stemmiation and lemmatization

Based on several research , i found following important compartive analysis :if we look on texts, most probably lemmatization should return more correct output right? not only correct, but also...

View Article

how to fix ImportError: cannot import name 'format_exception_only' in python

I am using pycharm community version for python 3.6.1 as I'm beginner when i try to run simple tokenize program - import nltkfrom nltk.tokenize import word_tokenizeword_tokenize(" hellow world im...

View Article

Image may be NSFW.
Clik here to view.

WorkerLost Error: Worker exited prematurely: signal 11 (SIGSEGV)

I tried to find the answer here but I didn't get the answer what I want.So I'm posting the question.import nltkfrom nltk.corpus import stopwordsfrom sklearn.decomposition import TruncatedSVDfrom...

View Article


Issue in Vercel Production. LookupError Resource not Found

`` **I am facing this error in production, i didn't face it locally. **[ERROR] 2023-08-07T16:26:11.466Z fb1bc7be-4061-455a-97b5-bb15babb27e5 Exception on /analyze_language [POST]Traceback (most recent...

View Article

The chatbot code works well on the console but not when deployed on the website

I tried to develop a chatbot using deep learning techniques and NLTK tools within the Python programming language. Initially, the chatbot performed satisfactorily when tested within the console...

View Article


Issue in loading model in recommender system using streamlit

I am building a restaurant recommender system, and I think the model is not loaded correctly. So everytime the reomm. system giving the output "Restaurant not found. Please enter a valid restaurant...

View Article

Problem with running a python code with NLTK on Render platform

I have my django project running on Render just fine, and i've been considering on implementing a chatbot using nltk. The problem occurs the moment the project itself is about to run. For some reason,...

View Article


Error related to nltk.download('stopwords')

When I run the following Python code in my local Jupyter notebook (in macOS)import nltkfrom nltk.corpus import stopwordsnltk.download('stopwords')I got the following errors:[nltk_data] Error loading...

View Article

How to stabalise the Kmeans cluster in python

I am analyzing to identify functional requirements within a given text. To achieve this, I have extracted nouns and verbs from the text and applied KMeans clustering to group similar semantic words...

View Article

NlTK Imports when program runs in VSC but when running from cmd returns...

I have written a program which collects synonyms using nltk wordnet which runs nicely when I press play in VSC. I now want to run it using Pypy3 from cmd. pypy3 is successfully running other programs....

View Article

Bad Result with NLTK's ResolutionProver in FOL (Python)

I'm working on a project using First-Order Logic (FOL) in Python with NLTK. I'm trying to build a simple knowledge base (KB) about Hogwarts houses and use the ResolutionProver to draw inferences....

View Article


Mosestokenizer issue: [WinError 2] The system cannot find the file specified

Can't figure out why is this problem appearing.from mosestokenizer import MosesDetokenizerwith MosesDetokenizer('en') as detokenize: print(detokenize(["hi", 'my', 'name', 'is', 'artem']))This is what I...

View Article


Error passing embedding matrix as weight to an lstm model

We were trying to sentimental analysis and we expected that the given embedded matrix to be passed on to the lstm model.However, we kept on consistently getting error on passing our embedding matrix to...

View Article

How to find common phrases from a text document

I have a text file with a lot of comments/sentences, and I want to somehow find the most common phrases repeated in the document itself. I tried fiddling with it a bit with NLTK and I found this...

View Article

How to find pmi and phrase-count for everygrams?

Using NLTK's library I can find metrics about bi and trigrams . Now I want to find all the possible phrases and find their occurence count and PMI score as I did with the bi-grams and trigrams like...

View Article


NLTK - AttributeError: module 'nltk' has no attribute 'data'

I used nltk in my code for a few days, but now, when I try to import nltk, I get the error:File "C:\Users\Nada\Anaconda\lib\site-packages\nltk\corpus\reader\plaintext.py", line 42, in...

View Article

SyntaxError: invalid syntax python nltk

Hi i'm currently learning python and I have an error i cant get rid of. It says :import nltk File "/home/yxnisss/.local/lib/python2.7/site-packages/nltk/__init__.py", line 128, in <modulefrom...

View Article

"Error: java.lang.RuntimeException: PipeMapRed.waitOutputThreads():...

I'm trying to run a Python program on Hadoop. The program involves the NLTK library. The program run very good withcat test.csv | ./testmaper.py | sort | ./testreducerBut when I'm run test it's mapper...

View Article

What is the benefit of NLP sentence segmentation over Python algorithm?

I have a task in NLP to do a sentence segmentation, but I wonder, what are the advantages of using built-in NLP sentence segmentation algorithms, such as Spacy, NLTK, BERT etc., over Python '.'...

View Article



Q : Python Spell Checker using NLTK

So i have this line of code using NLTK librarydef autospell(text): spells = [spell(w) for w in (nltk.word_tokenize(text))] return " ".join(spells) train_data['Phrase'][:200].apply(autospell) And i got...

View Article
Browsing latest articles
Browse All 82 View Live




Latest Images