Spaces:
Running
on
Zero
Running
on
Zero
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,34 +4,121 @@ emoji: ππ·οΈ
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: afl-3.0
|
| 11 |
---
|
| 12 |
|
| 13 |
-
# Named Entity Recognition (NER) App
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
-
- **User-Friendly Interface**: Built using Gradio for an easy-to-use web interface.
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
| 25 |
-
- **Framework**: Hugging Face Transformers
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
-
- **Transformers**: Used for model inference.
|
| 31 |
-
- **Spaces**: Utilized for GPU acceleration during model execution.
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.31.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: afl-3.0
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Named Entity Recognition (NER) App π·οΈ
|
| 14 |
|
| 15 |
+
A web-based Named Entity Recognition tool that automatically identifies and highlights entities like names, locations, organizations, and more from text using state-of-the-art NLP models. Built with Gradio and deployed on Hugging Face Spaces.
|
| 16 |
|
| 17 |
+

|
| 18 |
|
| 19 |
+
## π Live Demo
|
|
|
|
| 20 |
|
| 21 |
+
Try the app: [Named-Entity-Recognition](https://huggingface.co/spaces/ashish-soni08/Named-Entity-Recognition)
|
| 22 |
|
| 23 |
+
## β¨ Features
|
|
|
|
| 24 |
|
| 25 |
+
- **Automatic Entity Detection**: Instantly identify persons, locations, organizations, and miscellaneous entities
|
| 26 |
+
- **Visual Highlighting**: Entities are color-coded and highlighted for easy identification
|
| 27 |
+
- **Real-time Processing**: Get results in seconds with pre-trained BERT model
|
| 28 |
+
- **Clean Interface**: Intuitive web UI built with Gradio
|
| 29 |
+
- **Mobile Responsive**: Works seamlessly on desktop and mobile devices
|
| 30 |
|
| 31 |
+
## π οΈ Technology Stack
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
- **Backend**: Python, Hugging Face Transformers
|
| 34 |
+
- **Frontend**: Gradio
|
| 35 |
+
- **Model**: [dslim/bert-base-NER](https://huggingface.co/dslim/bert-base-NER)
|
| 36 |
+
- **Deployment**: Hugging Face Spaces
|
| 37 |
|
| 38 |
+
## πββοΈ Quick Start
|
| 39 |
+
|
| 40 |
+
### Prerequisites
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
Python 3.8+
|
| 44 |
+
pip
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
### Installation
|
| 48 |
+
|
| 49 |
+
1. Clone the repository:
|
| 50 |
+
```bash
|
| 51 |
+
git clone https://github.com/Ashish-Soni08/named-entity-recognition-app.git
|
| 52 |
+
cd ner-app
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
2. Install dependencies:
|
| 56 |
+
```bash
|
| 57 |
+
pip install -r requirements.txt
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
3. Run the application:
|
| 61 |
+
```bash
|
| 62 |
+
python app.py
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
4. Open your browser and navigate to `http://localhost:7860`
|
| 66 |
+
|
| 67 |
+
## π Usage
|
| 68 |
+
|
| 69 |
+
1. **Input Text**: Enter or paste the text you want to analyze in the "Text to find entities" box
|
| 70 |
+
2. **Process**: Click the "Submit" button to perform Named Entity Recognition
|
| 71 |
+
3. **View Results**: Identified entities will be highlighted with different colors based on their type
|
| 72 |
+
|
| 73 |
+
### Entity Types Detected
|
| 74 |
+
|
| 75 |
+
- **PER** (Person): Names of people
|
| 76 |
+
- **LOC** (Location): Geographic locations, cities, countries
|
| 77 |
+
- **ORG** (Organization): Companies, institutions, organizations
|
| 78 |
+
- **MISC** (Miscellaneous): Other named entities
|
| 79 |
+
|
| 80 |
+
### Example
|
| 81 |
+
|
| 82 |
+
**Input:**
|
| 83 |
+
```
|
| 84 |
+
Apple Inc. is headquartered in Cupertino, California. Tim Cook is the current CEO of the company.
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
**Output:**
|
| 88 |
+
```
|
| 89 |
+
[Apple Inc.](ORG) is headquartered in [Cupertino](LOC), [California](LOC). [Tim Cook](PER) is the current CEO of the company.
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
## π§ Model Information
|
| 93 |
+
|
| 94 |
+
This app uses **dslim/bert-base-NER**, a fine-tuned BERT model for Named Entity Recognition:
|
| 95 |
+
|
| 96 |
+
- **Architecture**: BERT-base
|
| 97 |
+
- **Parameters**: ~110 million parameters
|
| 98 |
+
- **Entity Types**: Person (PER), Location (LOC), Organization (ORG), Miscellaneous (MISC)
|
| 99 |
+
- **Performance**: F1-score of ~91%
|
| 100 |
+
|
| 101 |
+
## π Project Structure
|
| 102 |
+
|
| 103 |
+
```
|
| 104 |
+
ner-app/
|
| 105 |
+
βββ app.py # Main Gradio application
|
| 106 |
+
βββ requirements.txt # Python dependencies
|
| 107 |
+
βββ README.md # Project documentation
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
## π License
|
| 111 |
+
|
| 112 |
+
This project is licensed under the AFL-3.0 License - see the [LICENSE](LICENSE) file for details.
|
| 113 |
+
|
| 114 |
+
## π Acknowledgments
|
| 115 |
+
|
| 116 |
+
- [Hugging Face](https://huggingface.co/) for the Transformers library and model hosting
|
| 117 |
+
- [Gradio](https://gradio.app/) for the web interface framework
|
| 118 |
+
- [dslim](https://huggingface.co/dslim) for the fine-tuned BERT-NER model
|
| 119 |
+
|
| 120 |
+
## π Contact
|
| 121 |
+
|
| 122 |
+
Ashish Soni - [email protected]
|
| 123 |
+
|
| 124 |
+
Project Link: [Github](https://github.com/Ashish-Soni08/named-entity-recognition-app)
|