https://github.com/yukigeshiki/sentiment-analysis-cli-rust
A CLI tool to perform simple sentiment analysis written in Rust, using a Rust port of VADER.
https://github.com/yukigeshiki/sentiment-analysis-cli-rust
cli rust sentiment-analysis vader-sentiment-analysis webscraping
Last synced: 3 months ago
JSON representation
A CLI tool to perform simple sentiment analysis written in Rust, using a Rust port of VADER.
- Host: GitHub
- URL: https://github.com/yukigeshiki/sentiment-analysis-cli-rust
- Owner: Yukigeshiki
- License: mit
- Created: 2024-01-08T07:24:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-09T10:05:12.000Z (about 1 year ago)
- Last Synced: 2024-05-10T09:03:24.810Z (about 1 year ago)
- Topics: cli, rust, sentiment-analysis, vader-sentiment-analysis, webscraping
- Language: Rust
- Homepage:
- Size: 91.8 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sentiment-analysis-cli-rust
[](https://github.com/Yukigeshiki/sentiment-analysis-cli-rust/actions/workflows/ci.yml)
A CLI tool to perform simple sentiment analysis written in Rust, using a Rust port of [VADER](https://github.com/ckw017/vader-sentiment-rust).
Analysis can be performed on a text file or text within an HTML file. For HTML, you can supply a path to a file locally, or you can scrape HTML from the web. Currently, a CSS selector is used to specify the HTML element which contains the required text, but I hope to add xpath functionality in the future too.
### How to run:
First make sure you have Rust installed. To do this you can follow the instructions found [here](https://www.rust-lang.org/tools/install).
Clone the repo, cd into it and run:
```bash
cargo build --release
```To run for a text file:
```bash
./target/release/sentiment analyse text -p path/to/file/foo.txt
```To run for an HTML file:
```bash
./target/release/sentiment analyse html -p path/to/file/foo.html -s "div > div > p"
```To scrape and run for a webpage:
```bash
./target/release/sentiment analyse html -p https://page-to-scrape.com -s "div > div > p"
```For more info about the CLI tool, run:
```bash
./target/release/sentiment help
```or
```bash
./target/release/sentiment analyse help
```