-
Notifications
You must be signed in to change notification settings - Fork 8
/
spacy-universe.json
33 lines (33 loc) · 2.56 KB
/
spacy-universe.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
"id": "spacy-textblob",
"title": "spacytextblob",
"slogan": "A TextBlob sentiment analysis pipeline component for spaCy.",
"thumb": "https://github.com/SamEdwardes/spacytextblob/raw/main/docs/static/img/logo-thumb-square-250x250.png",
"description": "spacytextblob is a pipeline component that enables sentiment analysis using the [TextBlob](https://github.com/sloria/TextBlob) library. It will add the additional extension `._.blob` to `Doc`, `Span`, and `Token` objects.",
"github": "SamEdwardes/spacytextblob",
"pip": "spacytextblob",
"code_example": [
"import spacy",
"from spacytextblob.spacytextblob import SpacyTextBlob",
"",
"nlp = spacy.load('en_core_web_sm')",
"nlp.add_pipe('spacytextblob')",
"text = 'I had a really horrible day. It was the worst day ever! But every now and then I have a really good day that makes me happy.'",
"doc = nlp(text)",
"doc._.blob.polarity # Polarity: -0.125",
"doc._.blob.subjectivity # Subjectivity: 0.9",
"doc._.blob.sentiment_assessments.assessments # Assessments: [(['really', 'horrible'], -1.0, 1.0, None), (['worst', '!'], -1.0, 1.0, None), (['really', 'good'], 0.7, 0.6000000000000001, None), (['happy'], 0.8, 1.0, None)]",
"doc._.blob.ngrams() # [WordList(['I', 'had', 'a']), WordList(['had', 'a', 'really']), WordList(['a', 'really', 'horrible']), WordList(['really', 'horrible', 'day']), WordList(['horrible', 'day', 'It']), WordList(['day', 'It', 'was']), WordList(['It', 'was', 'the']), WordList(['was', 'the', 'worst']), WordList(['the', 'worst', 'day']), WordList(['worst', 'day', 'ever']), WordList(['day', 'ever', 'But']), WordList(['ever', 'But', 'every']), WordList(['But', 'every', 'now']), WordList(['every', 'now', 'and']), WordList(['now', 'and', 'then']), WordList(['and', 'then', 'I']), WordList(['then', 'I', 'have']), WordList(['I', 'have', 'a']), WordList(['have', 'a', 'really']), WordList(['a', 'really', 'good']), WordList(['really', 'good', 'day']), WordList(['good', 'day', 'that']), WordList(['day', 'that', 'makes']), WordList(['that', 'makes', 'me']), WordList(['makes', 'me', 'happy'])]"
],
"code_language": "python",
"url": "https://spacytextblob.netlify.app/",
"author": "Sam Edwardes",
"author_links": {
"twitter": "TheReaLSamlam",
"github": "SamEdwardes",
"website": "https://samedwardes.com"
},
"category": ["pipeline"],
"tags": ["sentiment", "textblob"],
"spacy_version": 3
}