/ Модель

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

Контекст
256 токенов
Лицензия
MIT
Архитектура
span-marker · dense
Базовая модель
span-marker-gelectra-large-germeval14
Библиотека
span-marker
Опубликована
26 апр 2024

span-marker-ktzh-stazh

Разметка токеновТекст → label4 профессии
30скачиваний за 30 дней0лайковвеса обновлены13 мая 2024

Описание модели

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

Модель SpanMarker для извлечения персон, географических названий и организаций из исторических и современных немецкоязычных документов кантона Цюрих.

SpanMarker KtZH StAZH — модель извлечения именованных сущностей, разработанная для документов кантонального совета и государственного архива Цюриха. Она дообучена на базе stefan-it/span-marker-gelectra-large-germeval14, использует архитектуру SpanMarker с энкодером GELECTRA Large и предназначена для разметки исторических и современных немецкоязычных текстов XIX–XX веков.

Модель выделяет персон, географические названия и организации, а также производные от именованных сущностей. Она рассчитана на протоколы заседаний кантонального совета, решения правительства кантона, тексты Corpus juris и официальный вестник кантона Цюрих. Максимальная длина последовательности — 256 токенов, сущности — до 8 слов. Лицензия — MIT.

В README приведены результаты перекрёстной проверки: F1 по классам PER, LOC и ORG составляет 0,97, 0,96 и 0,93 соответственно. Модель предназначена для конкретного архивного сценария; авторы не заявляют о её обобщении на другие документы. Разметка основана на неформальной схеме и может иметь особенности исходного корпуса.

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

  • разметка персон в протоколах заседаний кантонального совета Цюриха
  • извлечение географических названий из исторических документов кантона Цюрих
  • распознавание организаций в решениях правительства кантона
  • аннотирование именованных сущностей в текстах Corpus juris Цюриха
  • разметка сущностей в официальном вестнике кантона Цюрих

Ограничения

Модель ориентирована на архивные коллекции и официальный вестник кантона Цюрих, а её обобщение на другие документы не заявлено. Максимальная длина последовательности составляет 256 токенов, а распознаваемой сущности — 8 слов.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

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

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

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

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

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

Открыть на Hugging Face

SpanMarker KtZH StAZH

This is a SpanMarker model that is based on the GELECTRA Large variant of the SpanMarker for GermEval 2014 NER and further fine-tuned on meeting notes from the cantonal council, resolutions of the governing council and law text from the corpus juris of the Canton of Zurich. The documents span the 19th and 20th century, covering both historical language with varying degrees of standardization and contemporary language. Distinguished are PERson, LOCation, ORGanisation, as well as derivations of Named Entities (tag suffix -deriv).

The ORGanisation class has been extended to encompass institutions that have been deemed to be reasonably unambiguous in isolation or by virtue of their usage in the training data. Purely abstract/prototypical uses of institutions are generally out of scope (the model does not perform concept classification), can however occasionally arise.

Usage

The fine-tuned model can be used like:

from span_marker import SpanMarkerModel

# Download from the 🤗 Hub
model = SpanMarkerModel.from_pretrained("team-data-ktzh/span-marker-ktzh-stazh")

# Run inference
entities = model.predict("Hans Meier aus Dielsdorf vertritt im Kantonsrat die FDP.")

Model Details

Model Description

  • Model Type: SpanMarker
  • Encoder: deepset/gelectra-large (ELECTRA Large)
  • Maximum Sequence Length: 256 tokens
  • Maximum Entity Length: 8 words
  • Language: de
  • License: MIT

Model Sources

Model Labels

LabelExamples
PERHans Müller
LOCZürich
ORGSBB, Swissair, Kantonsrat, Bundesgericht
PERderivMüllersche
LOCderivzürcherische
ORGderivbundesgerichtlicher

Cross-validation evaluation

Evaluation relies on SpanMarker's internal evaluation code, which is based on seqeval.

Average per-label metrics

LabelPRF1
PER0.970.970.97
LOC0.950.960.96
ORG0.920.950.93
PERderiv0.400.300.33
LOCderiv0.860.850.85
ORGderiv0.730.760.74

Overall per-fold validation metrics

FoldPrecisionRecallF1Accuracy
00.9270.9520.9390.992
10.9420.9570.9490.993
20.9380.9460.9420.992
30.9210.9510.9360.992
40.9450.9490.9470.993

Confusion matrix

Confusion matrix

(Note that the confusion matrix also lists other labels from the GermEval 2014 dataset which are ignored in the context of this model.)

Bias, Risks and Limitations

Please note that this is released strictly as a task-bound model for the purpose of annotating historical and future documents from the collections it was trained on, as well as the official gazette of the Canton of Zurich. No claims of generalization are made outside of the specific use case it was developed for. The training data was annotated according to a specific but informal annotation scheme and the bias of the original model has been retained where it was found not to interfere with the use case. Be mindful of idiosyncrasies when applying to other documents.

Recommendations

The original XML documents of the training set can be found here. The annotations may be freely modified to tailor the model to an alternative use case. Note that a modified TEI Publisher and this Jupyter notebook are required to generate a Huggingface Dataset.

Training Details

Training Hyperparameters

  • learning_rate: Decay from 1e-05 to 5e-07
  • train_batch_size: 4
  • seed: 42
  • optimizer: AdamW with betas=(0.9,0.999), epsilon=1e-08, weight_decay=0.01
  • lr_scheduler_type: Polynomial (cubic)
  • lr_scheduler_warmup_ratio: 0.05
  • num_epochs: 10
  • gradient_accumulation_steps: 2
  • steps: 16000

Training data sources

The training data was sampled from the following collections from the data catalog of the Canton of Zurich, curated by the Staatsarchiv des Kantons Zürich (state archives of the Canton of Zurich):

Bibliography

This work builds upon:

@software{Aarsen_SpanMarker,
    author = {Aarsen, Tom},
    license = {Apache-2.0},
    title = {{SpanMarker for Named Entity Recognition}},
    url = {https://github.com/tomaarsen/SpanMarkerNER}
}

@article{aarsenspanmarker,
  title={SpanMarker for Named Entity Recognition},
  author={Aarsen, Tom and del Prado Martin, Fermin Moscoso and Suero, Daniel Vila and Oosterhuis, Harrie}
}

@inproceedings{ye-etal-2022-packed,
    title = "Packed Levitated Marker for Entity and Relation Extraction",
    author = "Ye, Deming  and
      Lin, Yankai  and
      Li, Peng  and
      Sun, Maosong",
    editor = "Muresan, Smaranda  and
      Nakov, Preslav  and
      Villavicencio, Aline",
    booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = may,
    year = "2022",
    address = "Dublin, Ireland",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.acl-long.337",
    doi = "10.18653/v1/2022.acl-long.337",
    pages = "4904--4917"}",
}

@misc{chan2020germans,
  author = {Chan, Branden and Schweter, Stefan and Möller, Timo},
  description = {German's Next Language Model},
  keywords = {bert gbert languagemodel lm},
  title = {German's Next Language Model},
  url = {http://arxiv.org/abs/2010.10906},
  year = 2020
}

@inproceedings{benikova-etal-2014-nosta,
    title = {NoSta-D Named Entity Annotation for German: Guidelines and Dataset},
    author = {Benikova, Darina  and
      Biemann, Chris  and
      Reznicek, Marc},
    booktitle = {Proceedings of the Ninth International Conference on Language Resources and Evaluation ({LREC}'14)},
    month = {may},
    year = {2014},
    address = {Reykjavik, Iceland},
    publisher = {European Language Resources Association (ELRA)},
    url = {http://www.lrec-conf.org/proceedings/lrec2014/pdf/276_Paper.pdf},
    pages = {2524--2531},
}

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

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

GPU в ailist

Универсальный рантайм · span-marker

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

Модели SpanMarker требуют отдельного рантайма.

Класс архитектуры
SpanMarkerModel
Ревизия весов
5601910

0 моделей