sentiment-analysis

How to labeling text based on aspect term and sentiment

How to labeling text based on aspect term and sentiment Question: I have coded to label text data by term aspect then sentiment with vader lexicon. But the result is only output -1 which means negative and 1 which means positive, where there should be 3 classes of positive, negative and neutral. Here is the …

Total answers: 1

How can I optimize KNN, GNB nd SVC sklearn algorithms to reduce exec time?

How can I optimize KNN, GNB nd SVC sklearn algorithms to reduce exec time? Question: I’m currently evaluating which classifier have the best performance for movie reviews sentiment analysis task. So far I have evaluate Logistic Regression, Linear Regression, Random Forest and Decision tree but I also want to consider KNN, GNB and SVC models …

Total answers: 1

Problem completing BERT model for sentiment classification

Problem completing BERT model for sentiment classification Question: I am trying to figure out sentiment classification on movie reviews using BERT, transformers and tensorflow. This is the code I currently have: def read_dataset(filename, model_name="bert-base-uncased"): """Reads a dataset from the specified path and returns sentences and labels""" tokenizer = BertTokenizer.from_pretrained(model_name) with open(filename, "r", encoding="utf-8") as f: …

Total answers: 1

Sklearn Model to JS

Sklearn Model to JS Question: I am working on a sentiment analysis project, where the backbone is ofc a model. This was developed using sklearn’s off the shelf solutions (MLP) trained with my data. I would like to "save" this model and use it again in JavaScript. Adam I have looked at pickle for python …

Total answers: 1

Kernel keeps dying while using BERT-based sentiment analysis model

Kernel keeps dying while using BERT-based sentiment analysis model Question: I’m trying to use german bert sentiment analysis on Jupyter Notebook. I have installed pytorch correctly but the Kernel keeps dying. I’m on a MacBook Pro ’21 with MacOs Monterey 12.3.1. I’ve installed Python 10.3.4. PyTorch does not show up in the list of installed …

Total answers: 2

Unable to import process_tweets from utils

Unable to import process_tweets from utils Question: Thanks for looking into this, I have a python program for which I need to have process_tweet and build_freqs for some NLP task, nltk is installed already and utils wasn’t so I installed it via pip install utils but the above mentioned two modules apparently weren’t installed, the …

Total answers: 5

Python Sentiment Analysis given a dataset with Facebook Posts

Python Sentiment Analysis given a dataset with Facebook Posts Question: I have a dataset containing raw facebook posts and comments. What I would like to do is to perform sentiment analysis with Python 3 (NTLK ?) in order to label each post and each comment against some categories (a sort of clustering in unsupervised mode). …

Total answers: 2

How to make a table or DataFrame from dtype=object?

How to make a table or DataFrame from dtype=object? Question: I would like to show how the predictions are made in a table or DataFrame. I tried to put X_test, y_test and predictions (predictions = model.predict(X_test)) into a DataFrame to show which reviews are positive or negative predicted. import pandas as pd predictions = model.predict(X_test) …

Total answers: 1

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

AttributeError: 'float' object has no attribute 'lower' Question: 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 …

Total answers: 6

Stanford nlp for python

Stanford nlp for python Question: All I want to do is find the sentiment (positive/negative/neutral) of any given string. On researching I came across Stanford NLP. But sadly its in Java. Any ideas on how can I make it work for python? Asked By: 90abyss || Source Answers: Textblob is a great package for sentimental …

Total answers: 10