mohammad748 commited on
Commit
2d337cd
·
verified ·
1 Parent(s): 616ef8f

Create README.md

Browse files

# DistilBERT for Named Entity Recognition

This project demonstrates fine-tuning **DistilBERT** for Named Entity Recognition (NER) using the **CoNLL-2003** dataset. The model is designed to detect and classify named entities in English text.

## Model Information

- **Pretrained Model:** distilbert-base-uncased
- **Dataset:** CoNLL-2003
- **Task:** Token Classification (NER)
- **Libraries:** PyTorch, Hugging Face Transformers

The model recognizes four main entity categories:

- **PER:** Person names
- **ORG:** Organizations
- **LOC:** Locations
- **MISC:** Miscellaneous entities

The predictions follow the BIO tagging scheme (`B-`, `I-`, and `O`) to distinguish entity boundaries.

## Using the Model

The fine-tuned model is available on Hugging Face Hub and can be used for inference with the `transformers` library.

```python
from transformers import pipeline

# Initialize the NER pipeline
ner = pipeline(
task="token-classification",
model="mohammad748/distilbert-conll2003-ner",
aggregation_strategy="simple"
)

# Sample sentence
text = "Microsoft was founded by Bill Gates and Paul Allen in the United States."

# Extract named entities
entities = ner(text)

for entity in entities:
print(entity)
```

The pipeline returns the detected entities along with their predicted categories, confidence scores, and character positions.

## Training Approach

The pretrained DistilBERT model was adapted to the NER task through supervised fine-tuning on CoNLL-2003. The process involved tokenization, label alignment, model training, and evaluation.

Files changed (1) hide show
  1. README.md +16 -0
README.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - eriktks/conll2003
5
+ language:
6
+ - en
7
+ metrics:
8
+ - accuracy
9
+ base_model:
10
+ - distilbert/distilbert-base-uncased
11
+ pipeline_tag: token-classification
12
+ library_name: transformers
13
+ tags:
14
+ - ner
15
+ - named-entity-recognition
16
+ ---