Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title: Manifesto Explainer
|
| 3 |
emoji: π
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: red
|
|
@@ -8,7 +8,67 @@ app_file: app.py
|
|
| 8 |
pinned: true
|
| 9 |
---
|
| 10 |
|
| 11 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
`title`: _string_
|
| 14 |
Display title for the Space
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Manifesto Explainer with LLM Enhancement
|
| 3 |
emoji: π
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: red
|
|
|
|
| 8 |
pinned: true
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Manifesto Explainer with LLM Enhancement
|
| 12 |
+
|
| 13 |
+
This application analyzes political manifestos using advanced NLP and LLM techniques. It provides various insights including word frequency analysis, sentiment analysis, word clouds, and AI-generated summaries.
|
| 14 |
+
|
| 15 |
+
## Features
|
| 16 |
+
|
| 17 |
+
- **AI-Generated Summary**: Uses Groq's LLaMA 3 model to generate concise summaries of manifestos
|
| 18 |
+
- **Enhanced Relevant Words Analysis**: Combines traditional frequency analysis with TF-IDF to find the most relevant topics
|
| 19 |
+
- **Context-Based Search**: Find specific terms within the manifesto with surrounding context
|
| 20 |
+
- **Visualizations**:
|
| 21 |
+
- Word Cloud: Visual representation of the most frequent words
|
| 22 |
+
- Sentiment Analysis: Analysis of positive, negative, and neutral sentiments
|
| 23 |
+
- Subjectivity Analysis: Analysis of subjective vs. objective content
|
| 24 |
+
- Frequency Distribution: Distribution of word frequencies
|
| 25 |
+
- Dispersion Plot: Visual representation of word occurrences throughout the text
|
| 26 |
+
|
| 27 |
+
## Setup
|
| 28 |
+
|
| 29 |
+
1. Install the required dependencies:
|
| 30 |
+
```
|
| 31 |
+
pip install -r requirements.txt
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
2. Set up your Groq API key:
|
| 35 |
+
- Rename the `.env.example` file to `.env`
|
| 36 |
+
- Add your Groq API key to the `.env` file:
|
| 37 |
+
```
|
| 38 |
+
GROQ_API_KEY=your_groq_api_key_here
|
| 39 |
+
```
|
| 40 |
+
- You can get a Groq API key by signing up at [https://console.groq.com/](https://console.groq.com/)
|
| 41 |
+
|
| 42 |
+
3. Run the application:
|
| 43 |
+
```
|
| 44 |
+
python app.py
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
4. Open the application in your web browser at the URL displayed in the terminal (typically http://127.0.0.1:7860)
|
| 48 |
+
|
| 49 |
+
## Usage
|
| 50 |
+
|
| 51 |
+
1. Upload a PDF file containing a political manifesto
|
| 52 |
+
2. Enter a search term to find specific mentions in the manifesto
|
| 53 |
+
3. Click "Analyze Manifesto" to process the document
|
| 54 |
+
4. View the results in the different tabs:
|
| 55 |
+
- **Summary**: AI-generated summary of the manifesto
|
| 56 |
+
- **Search Results**: Occurrences of your search term with context
|
| 57 |
+
- **Key Topics**: Most relevant topics identified using LLM-enhanced analysis
|
| 58 |
+
- **Visualizations**: Various visualizations of the manifesto content
|
| 59 |
+
|
| 60 |
+
## Example Manifestos
|
| 61 |
+
|
| 62 |
+
The application comes with example manifestos in the `Example` folder:
|
| 63 |
+
- AAP Manifesto 2019
|
| 64 |
+
- BJP Manifesto 2019
|
| 65 |
+
- Congress Manifesto 2019
|
| 66 |
+
|
| 67 |
+
## Note
|
| 68 |
+
|
| 69 |
+
If the Groq API key is not set up correctly, the summarization feature will be disabled, but all other features will continue to work.
|
| 70 |
+
|
| 71 |
+
## Configuration
|
| 72 |
|
| 73 |
`title`: _string_
|
| 74 |
Display title for the Space
|