textblob

No Module named textblob

心已入冬 提交于 2021-02-11 15:34:21
问题 I installed text blob with the line below on my PC: $ git clone https://github.com/sloria/TextBlob.git This then happened: pcarrera@LAP-JYT456465 ~/Python $ git clone https://github.com/sloria/TextBlob.git Cloning into 'TextBlob'... remote: Enumerating objects: 7, done. remote: Counting objects: 100% (7/7), done. remote: Compressing objects: 100% (6/6), done. remote: Total 3729 (delta 1), reused 0 (delta 0), pack-reused 3722 Receiving objects: 100% (3729/3729), 7.96 MiB | 10.79 MiB/s, done.

No Module named textblob

…衆ロ難τιáo~ 提交于 2021-02-11 15:33:40
问题 I installed text blob with the line below on my PC: $ git clone https://github.com/sloria/TextBlob.git This then happened: pcarrera@LAP-JYT456465 ~/Python $ git clone https://github.com/sloria/TextBlob.git Cloning into 'TextBlob'... remote: Enumerating objects: 7, done. remote: Counting objects: 100% (7/7), done. remote: Compressing objects: 100% (6/6), done. remote: Total 3729 (delta 1), reused 0 (delta 0), pack-reused 3722 Receiving objects: 100% (3729/3729), 7.96 MiB | 10.79 MiB/s, done.

textblob.exceptions.NotTranslated: Translation API returned the input string unchanged

空扰寡人 提交于 2021-02-10 22:21:25
问题 I am trying to translate non-english texts into english via textblob. I read documentation and trying to handle possible exceptions as below: txt=" " for word in text.split(): try: w=TextBlob(word) w=w.translate(to='en') except TranslatorError(TextBlobError): word=" " #replace word with space txt=txt+word except NotTranslated(TextBlobError): txt=txt+word+" " else: txt=txt+w+" " print(txt) I am getting the following errors: except TranslatorError(TextBlobError): NameError: name

textblob.exceptions.NotTranslated: Translation API returned the input string unchanged

天大地大妈咪最大 提交于 2021-02-10 22:19:11
问题 I am trying to translate non-english texts into english via textblob. I read documentation and trying to handle possible exceptions as below: txt=" " for word in text.split(): try: w=TextBlob(word) w=w.translate(to='en') except TranslatorError(TextBlobError): word=" " #replace word with space txt=txt+word except NotTranslated(TextBlobError): txt=txt+word+" " else: txt=txt+w+" " print(txt) I am getting the following errors: except TranslatorError(TextBlobError): NameError: name

Textblob - HTTPError: HTTP Error 429: Too Many Requests

青春壹個敷衍的年華 提交于 2021-01-26 03:54:51
问题 I am having a dataframe of which one column has a list of strings at each row. On average, each list has 150 words of about 6 characters each. Each of the 700 rows of the dataframe is about a document and each string is a word of this document; so basically I have tokenised the words of the document. I want to detect the language of each of these documents and to do this I firstly try to detect the language of each word of the document. For this reason I do the following: from textblob import

Sentiment analysis of non-English texts

痴心易碎 提交于 2021-01-21 09:25:41
问题 I want to analyze sentiment of texts that are written in German. I found a lot of tutorials on how to do this with English, but I found none on how to apply it to different languages. I have an idea to use the TextBlob Python library to first translate the sentences into English and then to do sentiment analysis, but I am not sure whether or not it is the best way to solve this task. Or are there any other possible ways to solve this task? 回答1: As Andy has pointed about above, the best

Sentiment analysis of non-English texts

▼魔方 西西 提交于 2021-01-21 09:21:06
问题 I want to analyze sentiment of texts that are written in German. I found a lot of tutorials on how to do this with English, but I found none on how to apply it to different languages. I have an idea to use the TextBlob Python library to first translate the sentences into English and then to do sentiment analysis, but I am not sure whether or not it is the best way to solve this task. Or are there any other possible ways to solve this task? 回答1: As Andy has pointed about above, the best

Removing stopwords from a textblob

前提是你 提交于 2020-07-05 10:14:51
问题 I'm processing a textblob and one of the steps is stopwords removal. Textblobs are immutable, so I'm turning one into a list to do the job: blob = tb(tekst) lista = [word for word in blob.words if word not in stopwords.words('english')] tekst = ' '.join(lista) blob = tb(tekst) Is there a simpler / more elegant solution for the problem? 来源: https://stackoverflow.com/questions/46959492/removing-stopwords-from-a-textblob

JSONDecodeError: Expecting value: line 1 column 1 (char 0) while translating text

社会主义新天地 提交于 2020-06-27 16:48:28
问题 I am getting the following error while translating a column from spanish to English: JSONDecodeError: Expecting value: line 1 column 1 (char 0) My data frame looks like the following: case_id es fr 1234 - - 2345 Hola como estas? Encantada de conocerte comment vas-tu aujourd'hui 3456 Hola como estas? Encantada de conocerte - 123321 - comment vas-tu aujourd'hui '-' is something that shows that there are no comments. My data frame has a blank strings as well apart from comments so I have