mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
add spacy_onnx_sentiment_english to universe (#12422)
* add spacy_onnx_sentiment_english to universe * rename to sentimental-onix * fix comma json error * fix typo * typo fix Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> * mention need to download model before example works Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> --------- Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
This commit is contained in:
parent
ae7779e830
commit
fd072533e7
|
@ -3215,6 +3215,51 @@
|
|||
"category": ["pipeline"],
|
||||
"tags": ["syllables", "multilingual"]
|
||||
},
|
||||
{
|
||||
"id": "sentimental-onix",
|
||||
"title": "Sentimental Onix",
|
||||
"slogan": "Use onnx for sentiment models",
|
||||
"description": "spaCy pipeline component for sentiment analysis using onnx",
|
||||
"github": "sloev/sentimental-onix",
|
||||
"pip": "sentimental-onix",
|
||||
"code_example": [
|
||||
"# Download model:",
|
||||
"# python -m sentimental_onix download en",
|
||||
"import spacy",
|
||||
"from sentimental_onix import pipeline",
|
||||
"",
|
||||
"nlp = spacy.load(\"en_core_web_sm\")",
|
||||
"nlp.add_pipe(\"sentencizer\")",
|
||||
"nlp.add_pipe(\"sentimental_onix\", after=\"sentencizer\")",
|
||||
"",
|
||||
"sentences = [",
|
||||
" (sent.text, sent._.sentiment)",
|
||||
" for doc in nlp.pipe(",
|
||||
" [",
|
||||
" \"i hate pasta on tuesdays\",",
|
||||
" \"i like movies on wednesdays\",",
|
||||
" \"i find your argument ridiculous\",",
|
||||
" \"soda with straws are my favorite\",",
|
||||
" ]",
|
||||
" )",
|
||||
" for sent in doc.sents",
|
||||
"]",
|
||||
"",
|
||||
"assert sentences == [",
|
||||
" (\"i hate pasta on tuesdays\", \"Negative\"),",
|
||||
" (\"i like movies on wednesdays\", \"Positive\"),",
|
||||
" (\"i find your argument ridiculous\", \"Negative\"),",
|
||||
" (\"soda with straws are my favorite\", \"Positive\"),",
|
||||
"]"
|
||||
],
|
||||
"thumb": "https://raw.githubusercontent.com/sloev/sentimental-onix/master/.github/onix.webp",
|
||||
"author": "Johannes Valbjørn",
|
||||
"author_links": {
|
||||
"github": "sloev"
|
||||
},
|
||||
"category": ["pipeline"],
|
||||
"tags": ["sentiment", "english"]
|
||||
},
|
||||
{
|
||||
"id": "gobbli",
|
||||
"title": "gobbli",
|
||||
|
|
Loading…
Reference in New Issue
Block a user