Comments (4)
Can you provide a minimal working example?
from sentimentr.
When there are no positive or negative words in the text, extract_sentiment_terms is not returning positive and negative lists.
extract_sentiment_terms("Data analysis, also known as analysis of data or data analytics, is a process of inspecting and modeling data with the goal of suggesting conclusions, and decision-making.")
extract_sentiment_terms("Data analysis, also known as analysis of data or data analytics, is a process of inspecting, cleansing, transforming, and modeling data with the goal of discovering useful information, suggesting conclusions, and supporting decision-making.")
If I use this along with data table, data table is throwing error as it was not able to find positive named list.
Is there any way you can update the code so that extract_sentiment_terms gives empty list of positive/negative terms when there are no positive/negative terms in the text.
from sentimentr.
I'm not seeing how you're using this with data.table? Can you show the use case?
from sentimentr.
dt <- data.table(comments = c("She is a good girl and I like her.", "He is arrogant."))
dt[, positive.terms := extract_sentiment_terms(comments)[,positive], by = "comments"]
Error in [.data.table
(extract_sentiment_terms(comments), , positive) :
j (the 2nd argument inside [...]) is a single symbol but column name 'positive' is not found. Perhaps you intended DT[,..positive] or DT[,positive,with=FALSE]. This difference to data.frame is deliberate and explained in FAQ 1.1.
In addition: Warning message:
In [.data.table
(dt, , :=
(positive.terms, extract_sentiment_terms(comments)[, :
RHS 1 is length 2 (greater than the size (1) of group 1). The last 1 element(s) will be discarded.
from sentimentr.
Related Issues (20)
- Any hint why the two emoji approaches are different and in what circumstance which one is better?! HOT 1
- Amplifiers
- polarity_dt requires words with spaces to work HOT 1
- Sentimentr split words when there is an accented character HOT 5
- Totally different results in Qdap polarity and sentiment r HOT 4
- Changing polarity of words in the dictionary HOT 2
- Question about 'highlight' HOT 1
- how to calculate sum of sentiment? HOT 1
- Question about how the dictionary was built HOT 1
- .mygsub is slow HOT 8
- Transparency for lexicon::hash_sentiment_jockers_rinker HOT 1
- What is the theoretical range for the "sentiment" variable? HOT 1
- I wonder why this sentence is recognized as positive HOT 2
- Polarity categorization? HOT 1
- relabel "black" and "white" as neutral sentiments (black is currently negative; white is labeled positive)
- Overall positive and negative scores given a piece of text
- Positive and Negative Sentiment based on German Language text HOT 1
- how to get pos, neg, neu other than ave_sentiment ?
- plot.sentiment_by ordered fix?
- N-CSR SIC code error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentimentr.