BERT Base NER (Named Entity Recognition)

Model Description

This is a BERT-based model fine-tuned for Named Entity Recognition (NER) tasks. The model can identify and classify named entities in text into predefined categories such as persons, organizations, locations, and more.

Model Type: Token Classification (Named Entity Recognition)
Base Model: BERT Base (bert-base-uncased)
Language: English
License: Apache 2.0

Model Details

Model Architecture

  • Base Architecture: BERT (Bidirectional Encoder Representations from Transformers)
  • Model Size: Base (110M parameters)
  • Hidden Size: 768
  • Number of Layers: 12
  • Attention Heads: 12
  • Max Sequence Length: 512 tokens

Training Data

The model was fine-tuned on annotated text data containing named entity labels. Training focused on recognizing common entity types in English text.

Entity Types

The model can recognize the following entity types:

  • PER (Person): Names of people
  • ORG (Organization): Companies, agencies, institutions
  • LOC (Location): Cities, countries, geographic locations
  • MISC (Miscellaneous): Other named entities not fitting the above categories

Intended Use

Primary Use Cases

  • Named Entity Extraction: Automatically identify and extract named entities from text
  • Information Extraction: Extract structured information from unstructured text
  • Document Analysis: Analyze documents to find mentions of people, places, and organizations
  • Data Preprocessing: Prepare text data for downstream NLP tasks
  • Content Categorization: Categorize content based on mentioned entities

Intended Users

  • NLP researchers and practitioners
  • Data scientists working with text data
  • Developers building information extraction systems
  • Content analysts and digital humanities researchers

How to Use

Installation

pip install transformers torch

Quick Start

from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

# Load model and tokenizer
model_name = "Mukesh97/Bert-NER"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)

# Create NER pipeline
ner_pipeline = pipeline(
    "ner",
    model=model,
    tokenizer=tokenizer,
    aggregation_strategy="simple"
)

# Example usage
text = "My name is John Smith and I work at Google in New York."
results = ner_pipeline(text)

for entity in results:
    print(f"{entity['word']}: {entity['entity_group']} (confidence: {entity['score']:.3f})")

Advanced Usage

from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch

# Load model
tokenizer = AutoTokenizer.from_pretrained("Mukesh97/Bert-NER")
model = AutoModelForTokenClassification.from_pretrained("Mukesh97/Bert-NER")

# Tokenize input
text = "Apple Inc. was founded by Steve Jobs in California."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)

# Get predictions
with torch.no_grad():
    outputs = model(**inputs)
    predictions = torch.argmax(outputs.logits, dim=-1)

# Decode predictions
tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
predicted_labels = [model.config.id2label[pred.item()] for pred in predictions[0]]

# Display results
for token, label in zip(tokens, predicted_labels):
    if token not in ['[CLS]', '[SEP]', '[PAD]']:
        print(f"{token}: {label}")

Batch Processing

# Process multiple texts efficiently
texts = [
    "Barack Obama was the President of the United States.",
    "Microsoft is headquartered in Redmond, Washington.",
    "The Eiffel Tower is in Paris, France."
]

results = ner_pipeline(texts)

for i, text_results in enumerate(results):
    print(f"\nText {i+1}: {texts[i]}")
    for entity in text_results:
        print(f"  - {entity['word']}: {entity['entity_group']}")

Performance

Evaluation Metrics

The model's performance can be evaluated using standard NER metrics:

  • Precision: Percentage of identified entities that are correct
  • Recall: Percentage of actual entities that were identified
  • F1-Score: Harmonic mean of precision and recall

Expected Performance

The model performs well on:

  • βœ“ Common person names (Western and international)
  • βœ“ Well-known organizations and companies
  • βœ“ Geographic locations (cities, countries, regions)
  • βœ“ Clean, well-formatted text

Limitations

Known Limitations

  1. Context Dependency: May struggle with ambiguous entities (e.g., "Apple" as fruit vs. company)
  2. Domain Specificity: Performance may vary on specialized domains (medical, legal, technical)
  3. Language: Optimized for English text only
  4. Named Entity Coverage: May not recognize very rare or newly emerging entities
  5. Spelling Sensitivity: Performance degrades with misspelled names
  6. Abbreviations: May have difficulty with uncommon abbreviations

Edge Cases

  • Nested Entities: May not handle complex nested entity structures
  • Multi-word Entities: Long entity names may be partially recognized
  • Informal Text: Performance may decrease on social media text, slang, or informal writing
  • Historical Names: May struggle with historical or archaic names and places

Ethical Considerations

Bias Considerations

  • The model may exhibit biases present in the training data
  • May perform differently across different demographic groups
  • Geographic bias: May recognize Western names/locations better than others
  • Temporal bias: May not recognize newly created entities or organizations

Responsible Use

  • Privacy: Be cautious when processing personal data; ensure compliance with data protection regulations (GDPR, CCPA, etc.)
  • Verification: Always verify critical information extracted by the model
  • Bias Mitigation: Be aware of potential biases and validate performance across diverse datasets
  • Transparency: Disclose the use of automated NER systems to end users when appropriate

Not Recommended For

  • ❌ Making critical decisions without human review
  • ❌ Processing highly sensitive personal information without proper safeguards
  • ❌ Applications where errors could cause significant harm
  • ❌ Legal or medical document analysis as the sole decision-making tool

Technical Specifications

Model Specifications

  • Framework: PyTorch / Transformers
  • Input Format: Raw text strings
  • Output Format: Token-level predictions with entity labels and confidence scores
  • Maximum Input Length: 512 tokens (longer texts will be truncated)
  • Vocabulary Size: 30,522 tokens

Computational Requirements

  • Inference:
    • CPU: ~100-200ms per sentence
    • GPU: ~10-20ms per sentence
    • Memory: ~500MB RAM
  • Recommended Hardware:
    • Minimum: 2GB RAM, any modern CPU
    • Optimal: GPU with 4GB+ VRAM for batch processing

Model Size

  • Model Files: ~420MB
  • Parameters: ~110 million
  • Quantized Version: Consider model quantization for deployment (reduces size by ~4x)

Model Card Authors: Mukesh
Last Updated: February 2026
Model Card Version: 1.0

Downloads last month
4
Safetensors
Model size
0.1B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Mukesh97/Bert-NER

Finetuned
(37)
this model