PaulSouvik commited on
Commit
d6b9484
Β·
verified Β·
1 Parent(s): 67c64b3

Added README with user instructions and examples

Browse files

Includes model info, usage guide, and placeholder examples.

Files changed (1) hide show
  1. README.md +54 -0
README.md CHANGED
@@ -10,5 +10,59 @@ pinned: false
10
  license: apache-2.0
11
  short_description: Zero-shot text label predictor.
12
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
10
  license: apache-2.0
11
  short_description: Zero-shot text label predictor.
12
  ---
13
+ # 🧠 Zero-Shot Text Classifier (Hugging Face Version)
14
+
15
+ A smart and lightweight web app built with **Gradio** and **Transformers** that classifies your input text into the most likely label β€” using **Zero-Shot Learning**.
16
+
17
+ ## 🧠 About the Model
18
+ - **Pipeline**: `zero-shot-classification`
19
+ - **Model**: `facebook/bart-large-mnli`
20
+ - **Framework**: Hugging Face Transformers
21
+ - **Task**: Predict a relevant label even if the model wasn't trained on it
22
+
23
+ ## πŸ’‘ Features
24
+ - Accepts custom comma-separated labels
25
+ - Returns top predictions with confidence scores
26
+ - Works in real-time β€” hosted via Hugging Face Spaces
27
+
28
+ ## βš™οΈ Instructions for Users
29
+ This app uses **zero-shot classification** to find the most relevant label based on your input and label list.
30
+
31
+ πŸ‘‰ **How to use:**
32
+ 1. Enter a sentence or paragraph
33
+ 2. Enter comma-separated labels like: `Technology, Sports, Food`
34
+ 3. The app will return top labels with confidence scores
35
+
36
+ ⚠️ **Note:**
37
+ - Avoid overlapping or vague labels. It may reduce prediction accuracy.
38
+ - For example, a sentence about economy and healthcare might score both **Finance** and **Health**.
39
+ - The answer may reflect multiple topics if the sentence spans more than one area β€” this is expected behavior in such cases.
40
+
41
+ βœ… **Example 1:**
42
+ - **Text:** `Roger Federer won another grand slam title, cementing his legacy in tennis.`
43
+ - **Labels:** `['Politics', 'Fashion', 'Sports']`
44
+ - **Prediction:** `Sports β€” 99.2%`
45
+
46
+ βœ… **Example 2:**
47
+ - **Text:** `The chef used fresh ingredients and spices to prepare a delicious Indian curry.`
48
+ - **Labels:** `['Food', 'Health', 'Travel']`
49
+ - **Prediction:** `Food β€” 88.9%`
50
+
51
+ βœ… **Example 3:**
52
+ - **Text:** `Climate change is leading to rising sea levels and more frequent extreme weather events.`
53
+ - **Labels:** `['Environment', 'Fashion', 'Technology']`
54
+ - **Prediction:** `Environment β€” 88.5%`
55
+
56
+ ---
57
+
58
+ ## πŸš€ How to Run Locally
59
+ Install the required packages:
60
+ ```bash
61
+ pip install -r requirements.txt
62
+ ```
63
+ Then run the app:
64
+ ```bash
65
+ python app.py
66
+ ```
67
 
68
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference