/ Модель

Характеристики

Лицензия
MIT
Библиотека
transformers
Опубликована
12 апр 2024

Neg-CamemBERT-bio

Разметка токеновТекст → label3 профессии

Франкоязычная модель CamemBERT для выделения маркеров отрицания и их области действия в биомедицинских текстах.

10скачиваний за 30 дней0лайковвеса обновлены30 апр 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Neg-CamemBERT-bio — модель Salim Sadoune, Antoine Richard, François Talbot, Thomas Guyet, Loic Boussel и Hugues Berry для выявления отрицания во франкоязычных биомедицинских текстах. Это дообученная версия CamemBERT-bio-base на базе архитектуры CamemBERT; она размечает токены, выделяя маркеры отрицания и область действия отрицания по схеме BIO. Модель подходит для анализа клинических текстов и биомедицинских публикаций, в том числе для автоматического определения, какие утверждения в тексте отрицаются. Контекст ограничен 512 токенами.

Модель обучена на французских корпусах ESSAI и CAS и оценивалась на отложенной части этих данных: F1 составил 96,68 для маркеров отрицания и 87,46 для их области действия. Результаты относятся к указанной в карточке выборке и не гарантируют такую же точность на других типах текстов. Авторы отмечают ограниченное число примеров некоторых редких отрицательных конструкций, что может ухудшать обобщение. Лицензия модели — MIT.

Сценарии применения

  • выделение маркеров отрицания во французских клинических текстах
  • определение области действия отрицания в биомедицинских предложениях
  • анализ отрицательных утверждений в клинических исследованиях
  • разметка отрицаний во франкоязычных медицинских публикациях

Ограничения

Обучающая выборка содержит мало примеров некоторых редких маркеров отрицания, поэтому модель может хуже обобщаться на такие конструкции. Указанные метрики получены на валидационной выборке ESSAI и CAS и не гарантируют аналогичного качества на иных корпусах.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Neg-CamemBERT-bio: Language model for negation detection in radiological and other clinical texts for the French language.

Neg-CamemBERT-bio is a refined version of the transformer-based CamemBERT-bio-base model, fine-tuned for the recognition of negations in clinical texts. Neg-CamemBERT-bio automatically detects both the negation cues and their scope. A public model is available for negation recognition in biomedical texts, along with two additional models that are kept private since trained with potentially sensitive data from Lyon University Hospital (Hospices Civils de Lyoon, HCL). — one dedicated to radiology reports and the other designed more broadly for various medical texts.

Model Details

1- Neg-CamemBERT-bio: Fine-tuning of the CamemBERT-bio-base model for negation recognition in biomedical texts in French.

2- Neg-Radio-CamemBERT-bio: Fine-tuning of the CamemBERT-bio-base model for negation recognition in anonymized texts extracted from French-written thoracic CT scans provided by the Radiology Department of the Hospices Civils of Lyon.

3- Neg-Medical-CamemBERT-bio: Fine-tuning of the CamemBERT-bio-base model for negation recognition in clinical texts across various medical domains (Radiology, Biomedical, Medical literature,...) in French.

Model nameTypeCorpus trainNumber of sentencesNegative sentences
Neg-CamemBERT-biopublicESSAI + CAS11 0371 812
Neg-Radio-CamemBERT-biopriviteRADIO10 7982 321
Neg-Medical-CamemBERT-biopriviteRADIO + ESSAI + CAS + QUAERO21 9564 244

Training Data

CorpusDetailsLicence
RADIOCorpus extracted from thoracic scan reports provided by the Radiology Department of Lyon University Hospital (Hospices Civils de Lyon, HCL).Private corpus
ESSAIESSAI Clinical is a freely-available corpus that contains clinical trial protocols in French language collected from the registry of the National Cancer Institute (data available here).CC BY-NC-SA 4.0 DEED
CASCAS is a freely-available corpus in French containing clinical cases as published in scientific, legal, or educational literature (data available here).CC BY-NC-SA 4.0 DEED
QUAEROQUAERO is freely-available corpus that contains a vast amount of information in the biomedical field and is available in the form of free-text in natural language (data available here).GNU Free Documentation License

The training dataset distinguishes between the beginning, inside, and end of each negation entity using a BIO annotation scheme.

AbbreviationDescription
OOutside of a named entity, represents the affirmative part of the sentence.
B-cueBeginning of the negation cue.
I-cueInside of the negation cue.
B-scopeBeginning of the negation scope.
I-scopeInside of the negation scope.

Fine-tuning

The CamemBERT-bio-base model, along with its tokenizer, was fine-tuned for the token classification task in order to identify negation cues and their scope. We used the Adam optimizer with a learning rate of 5e−5, and a batch size of 16. The maximum length limit was set to 512 tokens. The model was trained using cross-validation with 10 folds (90% training / 10% validation). For each fold, the model was trained for 25 epochs. We eventually selected the best model out of the 10 folds.

Evaluation

To evaluate the performance of the model and quantify the results, we used the following metrics: precision (P), recall (R), and the F1 score (F1). The scores were measured using the seqeval tool.

Results

Validation was performed on a 10% sample of sentences from the training set for each model.

Model'sValidation DatasetMetrcis ScoreEntity 1: cueEntity 2: scope
Neg-CamemBERT-bio10% (ESSAI+CAS)P95.70 ± 0.9486.43 ± 1.12
R97.70 ± 0.5685.55 ± 1.33
F196.68 ± 0.4687.46 ± 0.93
Neg-Radio-CamemBERT-bio10% (RADIO)P99.35 ± 0.2494.19 ± 0.94
R99.37 ± 0.3194.80 ± 0.84
F199.36 ± 0.2594.49 ± 0.80
Neg-Medical-CamemBERT-bio10%(NegRADIO + ESSAI + CAS + QUAERO)P97.75 ± 0.4590.48 ± 0.74
R98.67 ± 0.2091.34 ± 0.60
F198.20 ± 0.2190.90 ± 0.585

Model Description

  • Developed by: Salim SADOUNE, Antoine Richard, François Talbot,Thomas Guyet, Loic Boussel and Hugues Berry
  • Model type: NER
  • Language(s) (NLP): French
  • License: MIT
  • Finetuned from model: See the CamemBERT-bio-base model for more information on this model.

Direct Use

You can use the public model with Transformers pipeline for NER.

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("aistrosight/Neg-CamemBERT-bio")
model = AutoModelForTokenClassification.from_pretrained("aistrosight/Neg-CamemBERT-bio")

NegNamedEntityRecogniser = pipeline(task="token-classification", model=model , tokenizer = tokenizer,   aggregation_strategy="simple")

text = ["absence de signe d'anomalie des petites voies aériennes, notamment pas de signe de piégeage."]

sample =NegNamedEntityRecogniser(text)
print(sample)

You can visualize the cue and the scope of the negation with the library spacy in a Jupyter notebook.

import spacy
def visualize(sample, text):

    colors = {'scope_neg': "#61ffab", "cue_neg": "#ff6961"}
    options = {"ents": ['scope_neg', 'cue_neg'], "colors": colors}

    for i in range(len(sample)):
        entities = []
        for ents in sample[i]:
            entities.append({"end": ents["end"], "label": ents["entity_group"], "start": ents["start"]})
        displacy.render({"ents": entities,"text": text[i]}, style="ent", manual=True,options=options, jupyter=True)
visualize(sample,text)

Limitations and bias

The capacity of the Neg-CamemBERT-bio model is constrained due to the limited size of its training set, which includes a restricted number of examples for certain negation indicators ("sauf", "jamais", "hormis",...) that appear less frequently. This limitation poses challenges for generalizing to other cases. The tokenizer, not specifically designed for radiology, can lead to confusion for the Neg-Radio-CamemBERT-bio model when predicting the scope. It is important to note that both the Radio corpus and the ESSAI + CAS corpus have been annotated by different annotators on purpose, which may introduce confusion into the ability of the Neg-Medical-CamemBERT-bio model to predict this scope accurately.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · token-classification

Нельзя запустить

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
a858701

0 моделей