Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.38 KB

README.md

File metadata and controls

48 lines (30 loc) · 1.38 KB

sentiment-analysis-cli-rust

build

A CLI tool to perform simple sentiment analysis written in Rust, using a Rust port of VADER.

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.

Clone the repo, cd into it and run:

cargo build --release

To run for a text file:

./target/release/sentiment analyse text -p path/to/file/foo.txt

To run for an HTML file:

./target/release/sentiment analyse html -p path/to/file/foo.html -s "div > div > p"

To scrape and run for a webpage:

./target/release/sentiment analyse html -p https://page-to-scrape.com -s "div > div > p"

For more info about the CLI tool, run:

./target/release/sentiment help

or

./target/release/sentiment analyse help