File size: 3,503 Bytes
0df184a
 
47cf71e
0df184a
 
 
04964b8
0df184a
 
dfadaa9
0df184a
 
04964b8
47cf71e
04964b8
47cf71e
04964b8
47cf71e
04964b8
47cf71e
04964b8
47cf71e
04964b8
47cf71e
04964b8
 
 
 
 
47cf71e
04964b8
47cf71e
04964b8
 
 
 
47cf71e
04964b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dfadaa9
04964b8
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
title: Named Entity Recognition
emoji: πŸ”πŸ·οΈ
colorFrom: blue
colorTo: yellow
sdk: gradio
sdk_version: 5.31.0
app_file: app.py
pinned: false
license: apache-2.0
---

# Named Entity Recognition (NER) App 🏷️

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.

![Demo Screenshot](ner_logo.png)

## πŸš€ Live Demo

Try the app: [Named-Entity-Recognition](https://huggingface.co/spaces/ashish-soni08/Named-Entity-Recognition)

## ✨ Features

- **Automatic Entity Detection**: Instantly identify persons, locations, organizations, and miscellaneous entities
- **Visual Highlighting**: Entities are color-coded and highlighted for easy identification
- **Real-time Processing**: Get results in seconds with pre-trained BERT model
- **Clean Interface**: Intuitive web UI built with Gradio
- **Mobile Responsive**: Works seamlessly on desktop and mobile devices

## πŸ› οΈ Technology Stack

- **Backend**: Python, Hugging Face Transformers
- **Frontend**: Gradio
- **Model**: [dslim/bert-base-NER](https://huggingface.co/dslim/bert-base-NER)
- **Deployment**: Hugging Face Spaces

## πŸƒβ€β™‚οΈ Quick Start

### Prerequisites

```bash
Python 3.8+
pip
```

### Installation

1. Clone the repository:
```bash
git clone https://github.com/Ashish-Soni08/named-entity-recognition-app.git
cd ner-app
```

2. Install dependencies:
```bash
pip install -r requirements.txt
```

3. Run the application:
```bash
python app.py
```

4. Open your browser and navigate to `http://localhost:7860`

## πŸ“‹ Usage

1. **Input Text**: Enter or paste the text you want to analyze in the "Text to find entities" box
2. **Process**: Click the "Submit" button to perform Named Entity Recognition
3. **View Results**: Identified entities will be highlighted with different colors based on their type

### Entity Types Detected

- **PER** (Person): Names of people
- **LOC** (Location): Geographic locations, cities, countries
- **ORG** (Organization): Companies, institutions, organizations
- **MISC** (Miscellaneous): Other named entities

### Example

**Input:**
```
Apple Inc. is headquartered in Cupertino, California. Tim Cook is the current CEO of the company.
```

**Output:**
```
[Apple Inc.](ORG) is headquartered in [Cupertino](LOC), [California](LOC). [Tim Cook](PER) is the current CEO of the company.
```

## 🧠 Model Information

This app uses **dslim/bert-base-NER**, a fine-tuned BERT model for Named Entity Recognition:

- **Architecture**: BERT-base
- **Parameters**: ~110 million parameters
- **Entity Types**: Person (PER), Location (LOC), Organization (ORG), Miscellaneous (MISC)
- **Performance**: F1-score of ~91%

## πŸ“ Project Structure

```
ner-app/
β”œβ”€β”€ app.py                 # Main Gradio application
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ README.md             # Project documentation
```

## πŸ“„ License

This project is licensed under the Apache License 2.0

## πŸ™ Acknowledgments

- [Hugging Face](https://huggingface.co/) for the Transformers library and model hosting
- [Gradio](https://gradio.app/) for the web interface framework
- [dslim](https://huggingface.co/dslim) for the fine-tuned BERT-NER model

## πŸ“ž Contact

Ashish Soni - ashish.soni2091@gmail.com

Project Link: [Github](https://github.com/Ashish-Soni08/named-entity-recognition-app)