sentiment-analysis

Sentiment analysis and fasttext: import error

牧云@^-^@ 提交于 2020-06-01 07:40:48
问题 I want to run some sentiment analysis using FastText . However, I have always got errors during the declaration of libraries and no example and tutorial within the web seems to be able to fix this. I have tried to follow the steps described here: https://github.com/facebookresearch/fastText/tree/master/python#installation but since the beginning, i.e. since import fasttext from fasttext import train_unsupervised I have been getting the following error: ----------------------------------------

UnicodeDecodeError Sentiment140 Kaggle

亡梦爱人 提交于 2020-05-13 14:32:08
问题 I am trying to read the Sentiment140.csv available on Kaggle: https://www.kaggle.com/kazanova/sentiment140 My code is this one: import pandas as pd import os cols = ['sentiment','id','date','query_string','user','text'] BASE_DIR = '' df = pd.read_csv(os.path.join(BASE_DIR, 'Sentiment140.csv'),header=None, names=cols) And it gives me this error: UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 80-81: invalid continuation byte The things I would like to understand are: 1) How do

AttributeError: 'float' object has no attribute 'lower'

故事扮演 提交于 2020-04-13 06:21:38
问题 I'm facing this attribute error and I'm stuck at how to handle float values if they appear in a tweet.The streaming tweet has to be lower cased and tokenized so i have used split function. Can somebody please help me to deal with it, any workaround or solution ..? Here's the error which m gettin.... AttributeError Traceback (most recent call last) <ipython-input-28-fa278f6c3171> in <module>() 1 stop_words = [] ----> 2 negfeats = [(word_feats(x for x in p_test.SentimentText[f].lower().split()

How do I solve the following error?Input must be a character vector of any length or a list of character vectors, each of which has a length of 1.

本秂侑毒 提交于 2020-02-20 05:06:28
问题 I am working on a R project. The data set I used is available at the following link https://www.kaggle.com/ranjitha1/hotel-reviews-city-chennai/data The code I have used is. df1 = read.csv("chennai.csv", header = TRUE) library(tidytext) tidy_books <- df1 %>% unnest_tokens(word,Review_Text) Here Review_Text is the text column. Yet, I get the following error. Error in check_input(x) : Input must be a character vector of any length or a list of character vectors, each of which has a length of 1.

How do I solve the following error?Input must be a character vector of any length or a list of character vectors, each of which has a length of 1.

穿精又带淫゛_ 提交于 2020-02-20 04:54:34
问题 I am working on a R project. The data set I used is available at the following link https://www.kaggle.com/ranjitha1/hotel-reviews-city-chennai/data The code I have used is. df1 = read.csv("chennai.csv", header = TRUE) library(tidytext) tidy_books <- df1 %>% unnest_tokens(word,Review_Text) Here Review_Text is the text column. Yet, I get the following error. Error in check_input(x) : Input must be a character vector of any length or a list of character vectors, each of which has a length of 1.

How do I solve the following error?Input must be a character vector of any length or a list of character vectors, each of which has a length of 1.

╄→гoц情女王★ 提交于 2020-02-20 04:51:24
问题 I am working on a R project. The data set I used is available at the following link https://www.kaggle.com/ranjitha1/hotel-reviews-city-chennai/data The code I have used is. df1 = read.csv("chennai.csv", header = TRUE) library(tidytext) tidy_books <- df1 %>% unnest_tokens(word,Review_Text) Here Review_Text is the text column. Yet, I get the following error. Error in check_input(x) : Input must be a character vector of any length or a list of character vectors, each of which has a length of 1.

How to integrate the sentiment analysis script with the chatbot for analysing the user's reply in the same console screen?

给你一囗甜甜゛ 提交于 2020-01-16 08:19:31
问题 I want to make a chatbot that uses Sentiment analyser script for knowing the sentiment of the user's reply for which I have completed the Chatbot making. Now only thing I want to do is to use this Script to analyse the reply of user using the chatbot that I have made. How should I integrate this sentiment_analysis.py script with the chatbot.py file to analyse the sentiment's of user? Update: The overall performance will be like this : Chatbot: How was your day? User: It was an awesome day. I

Text analysis-Unable to write output of Python program in csv or xls file

耗尽温柔 提交于 2020-01-15 10:59:12
问题 Hi I am trying to do a sentiment analysis using Naive Bayes classifier in python 2.x. It reads the sentiment using a txt file and then gives output as positive or negative based on the sample txt file sentiments. I want the output the same form as input e.g. I have a text file of lets sat 1000 raw sentiments and I want the output to show positive or negative against each sentiment. Please help. Below is the code i am using import math import string def Naive_Bayes_Classifier(positive,