[](https://pypi.python.org/pypi/finvader)
[](https://pypi.python.org/pypi/finvader)
[]([https://opensource.org/licenses/MIT](https://opensource.org/license/apache-2-0/))
# FinVADER
**VADER sentiment classifier updated with financial lexicons**
**VADER** *(Valence Aware Dictionary and sEntiment Reasoner)* classifier is a mainstream model for sentiment analysis using a
general-language human-curated lexicon, including linguistic features expressed on social media. As such, the model works
worse on texts that use domain-specific language, such as finance or economics.
**FinVADER** improves VADER's classification accuracy, including two finance lexicons: [SentiBignomics](https://github.com/consose/SentiBigNomics),
and [Henry's word list](https://journals.sagepub.com/doi/10.1177/0021943608319388). *SentiBigNomics* is a detailed financial lexicon for aspect-based sentiment analysis with
approximately 7300 terms containing a polarity score ranging in [-1,1] for each item. *Henry's lexicon* covers 189 words
appearing in the company earnings press releases.
FinVADER outperforms VADER on Financial PhraseBank data:


The code for this benchmark test is [here](https://github.com/PetrKorab/FinVADER/blob/main/finvader_benchmark.ipynb)
****
## Installation
FinVADER requires [Python 3.8 - 3.11](https://www.python.org/downloads/), and [NLTK](http://www.nltk.org).
To install using pip, use:
`pip install finvader`
## Data requirements
It requires complete text data without NaN values and empty strings. Remove them in the pre-processing part.
## Usage
* **Import the library**:
``` python
from finvader import finvader
```
* **Select lexicons:**
``` python
def finvader(text = 'str', # Text
indicator = 'str', # VADER's indicator: 'pos'/'neg'/'neu'/'compound'
use_sentibignomics: bool= False, # Use SentiBignomics lexicon
use_henry: bool= False): # Use Henry's lexicon
)
```
* **Use the classifier:**
``` python
text = "The period's sales dropped to EUR 30.6 m from EUR 38.3 m, according to the interim report, released today."
scores = finvader(text,
use_sentibignomics = True,
use_henry = True,
indicator = 'compound' )
```
## Documentation, examples and tutorials
### Example of using the classifier:
``` python
import pandas as pd # read data
data = pd.read_csv("ecb_speeches.csv")
```
``` python
from finvader import finvader
data['finvader'] = data.contents.apply(finvader, # apply FinVADER and create a new column in data df
use_sentibignomics = True, # Use Lexicon 1
use_henry = True, # Use Lexicon 1
indicator="compound") # Use VADER's compound indicator
```
****
For examples of coding, read these tutorials:
**FinVADER: Sentiment Analysis for Financial Applications** [here](https://python.plainenglish.io/finvader-sentiment-analysis-for-financial-applications-6ab3c08840b4?sk=01b880558bd66b83b44618051e2e5df4)
**Fine-tuning VADER Classifier with Domain-specific Lexicons** [here](https://medium.com/mlearning-ai/fine-tuning-vader-classifier-with-domain-specific-lexicons-1b23f6882f2?sk=f36e92bc46ba2997e1fc5f4fe2c44bcc)
****
Please visit [here](https://github.com/PetrKorab/finvader/issues) for any questions, issues, bugs, and suggestions.
Raw data
{
"_id": null,
"home_page": "https://github.com/PetrKorab/FinVADER",
"name": "finvader",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Petr Kor\u00e1b",
"author_email": "Petr Korab <xpetrkorab@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/40/48/8920cd7b391a820b12850a9a3b4c465b173835cff715aff03f86a11d5622/finvader-1.0.3.tar.gz",
"platform": null,
"description": "[](https://pypi.python.org/pypi/finvader)\r\n[](https://pypi.python.org/pypi/finvader)\r\n[]([https://opensource.org/licenses/MIT](https://opensource.org/license/apache-2-0/))\r\n\r\n\r\n# FinVADER\r\n**VADER sentiment classifier updated with financial lexicons**\r\n\r\n\r\n**VADER** *(Valence Aware Dictionary and sEntiment Reasoner)* classifier is a mainstream model for sentiment analysis using a \r\ngeneral-language human-curated lexicon, including linguistic features expressed on social media. As such, the model works\r\nworse on texts that use domain-specific language, such as finance or economics.\r\n\r\n**FinVADER** improves VADER's classification accuracy, including two finance lexicons: [SentiBignomics](https://github.com/consose/SentiBigNomics),\r\nand [Henry's word list](https://journals.sagepub.com/doi/10.1177/0021943608319388). *SentiBigNomics* is a detailed financial lexicon for aspect-based sentiment analysis with \r\napproximately 7300 terms containing a polarity score ranging in [-1,1] for each item. *Henry's lexicon* covers 189 words \r\nappearing in the company earnings press releases. \r\n\r\nFinVADER outperforms VADER on Financial PhraseBank data: \r\n\r\n\r\n\r\n\r\nThe code for this benchmark test is [here](https://github.com/PetrKorab/FinVADER/blob/main/finvader_benchmark.ipynb)\r\n\r\n**** \r\n\r\n## Installation\r\n\r\nFinVADER requires [Python 3.8 - 3.11](https://www.python.org/downloads/), and [NLTK](http://www.nltk.org). \r\n\r\nTo install using pip, use:\r\n\r\n`pip install finvader`\r\n\r\n\r\n## Data requirements\r\n\r\nIt requires complete text data without NaN values and empty strings. Remove them in the pre-processing part. \r\n\r\n\r\n## Usage\r\n\r\n* **Import the library**:\r\n\r\n\r\n``` python\r\nfrom finvader import finvader\r\n```\r\n\r\n* **Select lexicons:**\r\n\r\n\r\n``` python\r\ndef finvader(text = 'str', # Text\r\n indicator = 'str', # VADER's indicator: 'pos'/'neg'/'neu'/'compound' \r\n use_sentibignomics: bool= False, # Use SentiBignomics lexicon\r\n use_henry: bool= False): # Use Henry's lexicon\r\n) \r\n```\r\n\r\n* **Use the classifier:**\r\n\r\n``` python\r\ntext = \"The period's sales dropped to EUR 30.6 m from EUR 38.3 m, according to the interim report, released today.\"\r\n\r\nscores = finvader(text, \r\n use_sentibignomics = True, \r\n use_henry = True, \r\n indicator = 'compound' )\r\n```\r\n\r\n## Documentation, examples and tutorials\r\n\r\n### Example of using the classifier: \r\n\r\n``` python\r\nimport pandas as pd # read data\r\ndata = pd.read_csv(\"ecb_speeches.csv\")\r\n```\r\n\r\n``` python\r\nfrom finvader import finvader \r\ndata['finvader'] = data.contents.apply(finvader, # apply FinVADER and create a new column in data df\r\n use_sentibignomics = True, # Use Lexicon 1\r\n use_henry = True, # Use Lexicon 1\r\n indicator=\"compound\") # Use VADER's compound indicator\r\n```\r\n\r\n**** \r\n\r\nFor examples of coding, read these tutorials:\r\n\r\n**FinVADER: Sentiment Analysis for Financial Applications** [here](https://python.plainenglish.io/finvader-sentiment-analysis-for-financial-applications-6ab3c08840b4?sk=01b880558bd66b83b44618051e2e5df4)\r\n\r\n**Fine-tuning VADER Classifier with Domain-specific Lexicons** [here](https://medium.com/mlearning-ai/fine-tuning-vader-classifier-with-domain-specific-lexicons-1b23f6882f2?sk=f36e92bc46ba2997e1fc5f4fe2c44bcc)\r\n**** \r\n\r\nPlease visit [here](https://github.com/PetrKorab/finvader/issues) for any questions, issues, bugs, and suggestions.\r\n",
"bugtrack_url": null,
"license": "OSI Approved :: Apache Software License",
"summary": "VADER sentiment classifier updated with financial lexicons",
"version": "1.0.3",
"project_urls": {
"Bug Tracker": "https://github.com/PetrKorab/FinVADER/issues",
"Homepage": "https://github.com/PetrKorab/FinVADER"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "29876ead3778708f9266eaa48ecc1fe404d62cd39ab5a537be7e9883fb4d9fef",
"md5": "b6dfb46d10314bd7c71e8fef18ede50e",
"sha256": "0e049af9a7da2709103cdc7f7d441f1f7b65fe5b0171095c2be8abe5f36b0a64"
},
"downloads": -1,
"filename": "finvader-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b6dfb46d10314bd7c71e8fef18ede50e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 45255,
"upload_time": "2023-12-04T13:42:05",
"upload_time_iso_8601": "2023-12-04T13:42:05.391233Z",
"url": "https://files.pythonhosted.org/packages/29/87/6ead3778708f9266eaa48ecc1fe404d62cd39ab5a537be7e9883fb4d9fef/finvader-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "40488920cd7b391a820b12850a9a3b4c465b173835cff715aff03f86a11d5622",
"md5": "160f11871ece3db2241fe7b18dc4b9ee",
"sha256": "21d76d6cad206b026714d5a03b0be92646eecab287a9bbd599386457dbfa37eb"
},
"downloads": -1,
"filename": "finvader-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "160f11871ece3db2241fe7b18dc4b9ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 46278,
"upload_time": "2023-12-04T13:42:07",
"upload_time_iso_8601": "2023-12-04T13:42:07.418374Z",
"url": "https://files.pythonhosted.org/packages/40/48/8920cd7b391a820b12850a9a3b4c465b173835cff715aff03f86a11d5622/finvader-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-04 13:42:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PetrKorab",
"github_project": "FinVADER",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "finvader"
}