Skip to content

Commit

Permalink
update to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
fhamborg committed Dec 13, 2021
1 parent c1fa7bb commit 3cae5cf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include READMEpypi.md
include pythoninfo.md
1 change: 1 addition & 0 deletions NewsSentiment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from NewsSentiment.infer import TargetSentimentClassifier
31 changes: 9 additions & 22 deletions READMEpypi.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,25 @@ and the model can be found [here](https://aclanthology.org/2021.eacl-main.142.pd
dataset, the model, and its source code can be viewed in our [GitHub repository](https://github.com/fhamborg/NewsMTSC).

# Installation
It's super easy, we promise!
It's super easy, we promise!

NewsMTSC was tested on MacOS and Ubuntu; other OS may work, too. Let us know :-)
You just need a Python 3.7 or Python 3.8 environment. See [here](pythoninfo.md) if you
don't have Python or a different version (run `python --version` in a terminal to see
your version). Then run:

**1. Setup the environment:**

This step is optional if you have Python 3.7 installed already (run `python --version`
in a terminal and check the version that is printed). If you don't have Python 3.7, we
recommend using Anaconda for setting up requirements because it is very easy (but any way
of installing Python 3.7 is fine). If you do not have Anaconda yet, follow their
[installation instructions](https://docs.anaconda.com/anaconda/install/).

After installing Anaconda, to setup a Python 3.7 environment (in case you don't have one
yet) execute:
```bash
conda create --yes -n newsmtsc python=3.7
conda activate newsmtsc
```

**2. Install NewsSentiment:**
```bash
pip3 install NewsSentiment # without cuda support (choose this if you don't know what cuda is)
pip3 install NewsSentiment[cuda] # with cuda support
```

You're all set now, all required models will automatically download on-demand :-)

Note that using NewsSentiment the first time may take a few minutes before the model is fully
download. This is a one-time process and future use of NewsSentiment will be much faster.
You're all set now, all required models will automatically download on-demand :-)

# Target-dependent Sentiment Classification

Note that using NewsSentiment the first time may take a few minutes because it needs
to download the fine-tuned language model. This is a one-time process, and future use of
NewsSentiment will be much faster.

```python
from NewsSentiment import TargetSentimentClassifier
tsc = TargetSentimentClassifier()
Expand Down
13 changes: 13 additions & 0 deletions pythoninfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This step is optional if you have Python 3.7 or 3.8 installed (run `python --version`
in a terminal and check the version that is printed). If you don't have Python 3.7, we
recommend using Anaconda for setting up requirements because it is very easy (but any way
of installing Python 3.7 is fine). If you do not have Anaconda yet, follow their
[installation instructions](https://docs.anaconda.com/anaconda/install/).

After installing Anaconda, to set up a Python 3.7 environment (in case you don't have one
yet) execute:

```bash
conda create --yes -n newsmtsc python=3.7
conda activate newsmtsc
```
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = NewsSentiment
version = 1.0.2
version = 1.1.1
author = Felix Hamborg
author_email = felix.hamborg@uni-konstanz.de
description = Easy-to-use, high-quality target-dependent sentiment classification for news articles
Expand Down Expand Up @@ -46,7 +46,6 @@ install_requires =
scikit-learn>=1.0.1
spacy>=2.1,<3
tabulate>=0.8.9
torchvision>=0.8.2
tqdm>=4.62.3
transformers>=3.1.0,<4

Expand Down

0 comments on commit 3cae5cf

Please sign in to comment.