NuNER-BERT-v1.0 / README.md
Serega6678's picture
Update README.md
e542684 verified
|
raw
history blame
1.99 kB
metadata
language:
  - en
license: mit
tags:
  - token-classification
  - entity-recognition
  - foundation-model
  - feature-extraction
  - BERT
  - generic
datasets:
  - numind/NuNER
pipeline_tag: token-classification
inference: false

SOTA Entity Recognition English Foundation Model by NuMind 🔥

This model provides the embedding for the Entity Recognition task in English.

We recommend firstly trying NuNER RoBERTa as it usually shows better results

Checkout other models by NuMind:

  • SOTA Multilingual Entity Recognition Foundation Model: link
  • SOTA Sentiment Analysis Foundation Model: English, Multilingual

About

bert-base-uncased fine-tuned on NuNER data.

Metrics:

Read more about evaluation protocol & datasets in our paper and blog post.

Usage

Embeddings can be used out of the box or fine-tuned on specific datasets.

Get embeddings:

import torch
import transformers


model = transformers.AutoModel.from_pretrained(
    'numind/NuNER-BERT-v1.0',
    output_hidden_states=True
)
tokenizer = transformers.AutoTokenizer.from_pretrained(
    'numind/NuNER-BERT-v1.0'
)

text = [
    "NuMind is an AI company based in Paris and USA.",
    "See other models from us on https://huggingface.co/numind"
]
encoded_input = tokenizer(
    text,
    return_tensors='pt',
    padding=True,
    truncation=True
)
output = model(**encoded_input)

# for better quality
emb = torch.cat(
    (output.hidden_states[-1], output.hidden_states[-7]),
    dim=2
)

# for better speed
# emb = output.hidden_states[-1]