AventIQ-AI / named-entity-recognition-for-information-extraction

huggingface.co
Total runs: 22
24-hour runs: 1
7-day runs: 4
30-day runs: 3
Model's Last Updated: April 08 2025

Introduction of named-entity-recognition-for-information-extraction

Model Details of named-entity-recognition-for-information-extraction

Named Entity Recognition (NER) of Information Extraction

📌 Overview

This repository hosts the quantized version of the bert-base-cased model for Named Entity Recognition (NER) using the CoNLL-2003 dataset. The model is specifically designed to recognize entities related to Person (PER), Organization (ORG), and Location (LOC) . The model has been optimized for efficient deployment while maintaining high accuracy, making it suitable for resource-constrained environments.

🏗 Model Details
  • Model Architecture : BERT Base Cased
  • Task : Named Entity Recognition (NER) of Information Extraction
  • Dataset : Hugging Face's CoNLL-2003
  • Quantization : BrainFloat16
  • Fine-tuning Framework : Hugging Face Transformers

🚀 Usage
Installation
pip install transformers torch
Loading the Model
from transformers import BertTokenizerFast, BertForTokenClassification
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"

model_name = "AventIQ-AI/named-entity-recognition-for-information-extraction"
model = BertForTokenClassification.from_pretrained(model_name).to(device)
tokenizer = BertTokenizerFast.from_pretrained(model_name)
Named Entity Recognition Inference
label_list = ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"]
🔹 Labeling Scheme (BIO Format)
  • B-XYZ (Beginning) : Indicates the beginning of an entity of type XYZ (e.g., B-PER for the beginning of a person’s name).
  • I-XYZ (Inside) : Represents subsequent tokens inside an entity (e.g., I-PER for the second part of a person’s name).
  • O (Outside) : Denotes tokens that are not part of any named entity.
def predict_entities(text, model):

    tokens = tokenizer(text, return_tensors="pt", truncation=True)
    tokens = {key: val.to(device) for key, val in tokens.items()}  # Move to CUDA

    with torch.no_grad():
        outputs = model(**tokens)
    
    logits = outputs.logits  # Extract logits
    predictions = torch.argmax(logits, dim=2)  # Get highest probability labels

    tokens_list = tokenizer.convert_ids_to_tokens(tokens["input_ids"][0])
    predicted_labels = [label_list[pred] for pred in predictions[0].cpu().numpy()]

    final_tokens = []
    final_labels = []
    for token, label in zip(tokens_list, predicted_labels):
        if token.startswith("##"):  
            final_tokens[-1] += token[2:]  # Merge subword
        else:
            final_tokens.append(token)
            final_labels.append(label)

    for token, label in zip(final_tokens, final_labels):
        if token not in ["[CLS]", "[SEP]"]:
            print(f"{token}: {label}")

# 🔍 Test Example
sample_text = "Elon Musk is the CEO of Tesla, which is based in California."
predict_entities(sample_text, model)

📊 Evaluation Results for Quantized Model
🔹 Overall Performance
  • Accuracy : 97.10% ✅
  • Precision : 89.52%
  • Recall : 90.67%
  • F1 Score : 90.09%

🔹 Performance by Entity Type
Entity Type Precision Recall F1 Score Number of Entities
LOC (Location) 91.46% 92.07% 91.76% 3,000
MISC (Miscellaneous) 71.25% 72.83% 72.03% 1,266
ORG (Organization) 89.83% 93.02% 91.40% 3,524
PER (Person) 95.16% 94.04% 94.60% 2,989

⏳ Inference Speed Metrics
  • Total Evaluation Time : 15.89 sec
  • Samples Processed per Second : 217.26
  • Steps per Second : 27.18
  • Epochs Completed : 3

Fine-Tuning Details
Dataset

The Hugging Face's CoNLL-2003 dataset was used, containing texts and their ner tags.

📊 Training Details
  • Number of epochs : 3
  • Batch size : 8
  • Evaluation strategy : epoch
  • Learning Rate : 2e-5
⚡ Quantization

Post-training quantization was applied using PyTorch's built-in quantization framework to reduce the model size and improve inference efficiency.


📂 Repository Structure
.
├── model/               # Contains the quantized model files
├── tokenizer_config/    # Tokenizer configuration and vocabulary files
├── model.safetensors/   # Quantized Model
├── README.md            # Model documentation

⚠️ Limitations
  • The model may not generalize well to domains outside the fine-tuning dataset.
  • Quantization may result in minor accuracy degradation compared to full-precision models.

🤝 Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request if you have suggestions or improvements.

Runs of AventIQ-AI named-entity-recognition-for-information-extraction on huggingface.co

22
Total runs
1
24-hour runs
2
3-day runs
4
7-day runs
3
30-day runs

More Information About named-entity-recognition-for-information-extraction huggingface.co Model

named-entity-recognition-for-information-extraction huggingface.co

named-entity-recognition-for-information-extraction huggingface.co is an AI model on huggingface.co that provides named-entity-recognition-for-information-extraction's model effect (), which can be used instantly with this AventIQ-AI named-entity-recognition-for-information-extraction model. huggingface.co supports a free trial of the named-entity-recognition-for-information-extraction model, and also provides paid use of the named-entity-recognition-for-information-extraction. Support call named-entity-recognition-for-information-extraction model through api, including Node.js, Python, http.

named-entity-recognition-for-information-extraction huggingface.co Url

https://huggingface.co/AventIQ-AI/named-entity-recognition-for-information-extraction

AventIQ-AI named-entity-recognition-for-information-extraction online free

named-entity-recognition-for-information-extraction huggingface.co is an online trial and call api platform, which integrates named-entity-recognition-for-information-extraction's modeling effects, including api services, and provides a free online trial of named-entity-recognition-for-information-extraction, you can try named-entity-recognition-for-information-extraction online for free by clicking the link below.

AventIQ-AI named-entity-recognition-for-information-extraction online free url in huggingface.co:

https://huggingface.co/AventIQ-AI/named-entity-recognition-for-information-extraction

named-entity-recognition-for-information-extraction install

named-entity-recognition-for-information-extraction is an open source model from GitHub that offers a free installation service, and any user can find named-entity-recognition-for-information-extraction on GitHub to install. At the same time, huggingface.co provides the effect of named-entity-recognition-for-information-extraction install, users can directly use named-entity-recognition-for-information-extraction installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

named-entity-recognition-for-information-extraction install url in huggingface.co:

https://huggingface.co/AventIQ-AI/named-entity-recognition-for-information-extraction

Url of named-entity-recognition-for-information-extraction

named-entity-recognition-for-information-extraction huggingface.co Url

Provider of named-entity-recognition-for-information-extraction huggingface.co

AventIQ-AI
ORGANIZATIONS

Other API from AventIQ-AI