From dd9bfa8d3311584c9aff2abeeea24f0d0d19166b Mon Sep 17 00:00:00 2001 From: samhithamuvva <163280630+samhithamuvva@users.noreply.github.com> Date: Thu, 10 Oct 2024 03:09:44 -0700 Subject: [PATCH] Add logistic regression sentiment analysis --- README.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d59a94f50..c3e56ca2f 100644 --- a/README.md +++ b/README.md @@ -227,32 +227,30 @@ nlp = en_core_web_sm.load() doc = nlp("This is a sentence.") ``` -📖 **For more info and examples, check out the -[models documentation](https://spacy.io/docs/usage/models).** - -## 📊 Custom Sentiment Analysis with Logistic Regression - -This implementation includes a custom **Logistic Regression** sentiment analysis model built using spaCy, without using scikit-learn. The model classifies text as positive or negative based on datasets like IMDb reviews. +## 📊 Custom Sentiment Analysis with Logistic Regression (spaCy-based) +This repository also includes a custom **Logistic Regression** sentiment analysis model built using spaCy, without using scikit-learn. The model classifies text as positive or negative based on a dataset such as IMDb reviews. ### Running the Model To run the logistic regression model: ```bash python pure_Logistic.py -``` +```This script processes the dataset using spaCy, trains the logistic regression model, and outputs the results. ### Testing and Evaluation -To run tests and evaluate the model's performance: +To run tests and evaluate the model's performance, use: ```bash python test_pure_logistic.py ``` -To use the model in your own code: -```python +In your test script, import the PureLogisticTextCategorizer class for evaluation: +```bash from pure_Logistic import PureLogisticTextCategorizer - -# Initialize and use the classifier -categorizer = PureLogisticTextCategorizer() ``` +This enables you to evaluate the logistic regression classifier on your test cases. + + +📖 **For more info and examples, check out the +[models documentation](https://spacy.io/docs/usage/models).** ## ⚒ Compile from source @@ -311,4 +309,4 @@ Alternatively, you can run `pytest` on the tests from within the installed ```bash pip install -r requirements.txt python -m pytest --pyargs spacy -``` \ No newline at end of file +```