hf_mirrors/ner-bertje-tagdetekst
Model Introduction
Files & versions
Analysis

AI-Trainingset – Tag de Tekst voor Named Entity Recognition (NER) De AI-trainingset voor NER is in 2020 gemaakt door de circa 150 vrijwilligers van het crowdsourcingsproject "Tag de tekst" op VeleHanden.nl. Persoonsnamen, locaties en tijdsaanduidingen zijn geannoteerd in al eerder ontwikkelde Ground Truth-transcripties (GT-transcripties) van 10.567 scans en gecontroleerd door drie ervaren super users. Een uitgebreide beschrijving van de gehanteerde definities is te vinden in de invoerinstructie van "Tag de tekst". De Nederlandstalige teksten komen uit de 17e eeuw tot en met de 19e eeuw. Het gaat om notariële teksten uit Amsterdam, Haarlem en uit zeven andere provincies en archieven van de Verenigde Oost-Indische Compagnie (VOC). Ze zijn afkomstig uit het Stadsarchief Amsterdam, het Nationaal Archief, het Noord-Hollands Archief, en zeven andere Regionaal Historische Centra: Tresoar, het Gelders Archief, de Groningen Archieven, het Brabants Historisch Informatie Centrum, het Zeeuws Archief, het Historisch Centrum Limburg, Het Utrechts Archief en de Collectie Overijssel. De AI-trainingset is ontwikkeld i.h.k.v. de projecten "De IJsberg zichtbaar maken" (zoekintranscripties.nl) en "Slimmer zoeken in archieven" (archieveninbeeld.nl).

Productdetails Dataformaat XML Jaar 2022 Project "Tag de Tekst" op VeleHanden.nl Gerealiseerd door Picturae, Aincient, Sioux Technologies, Islands of Meaning, de deelnemende archieven en vrijwilligers van VeleHanden.nl Documentatie Toelichting Refereren AI-Trainingset for NER (Version 1.0) (2022) [Data set]. Available at the Dutch Language Institute: https://hdl.handle.net/10032/tm-a2-v2 Talen Nederlands Licentie Creative Commons-Licentie Creative Commons Naamsvermelding 4.0 Internationaal-licentie Versie 1.0

Use with openMind

environment variable

# source environment variable
source /usr/local/Ascend/ascend-toolkit/set_env.sh
export OPENMIND_FRAMEWORK=pt

pip install openMind Library

OpenMind Library can be installed through pip, please select the corresponding command according to the actual environment for installation.

It should be noted that since torch npu depends on torch, which can be directly installed through pip in aarch64, but requires a specific URL to download the CPU version in x86, the installation commands in the two environments are different. The specific installation code has been distinguished and presented in the following text.

# aarch64
pip install openmind[all]
# x86
pip install openmind[all] --extra-index-url https://download.pytorch.org/whl/cpu

Inference

from openmind import AutoTokenizer, AutoModelForCausalLM
import torch
import torch_npu

model_dir = "HangZhou_Ascend/ner-bertje-tagdetekst"
tokenizer = AutoTokenizer.from_pretrained(model_dir, device_map="auto", trust_remote_code=True)
# Set `torch_dtype=torch.float16` to load model in float16, otherwise it will be loaded as float32 and might cause OOM Error.
model = AutoModelForCausalLM.from_pretrained(model_dir, device_map="auto",  trust_remote_code=True, torch_dtype=torch.float16)
model = model.eval()
response, history = model.chat(tokenizer, "1+1=", history=[], meta_instruction="")
print(response)