模型:
akdeniz27/bert-base-turkish-cased-ner
这个模型是使用评估过的著名的土耳其NER数据集的经调优版本( https://github.com/stefan-it/turkish-bert/files/4558187/nerdata.txt )对"dbmdz/bert-base-turkish-cased"模型进行的微调。
task = "ner" model_checkpoint = "dbmdz/bert-base-turkish-cased" batch_size = 8 label_list = ['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC'] max_length = 512 learning_rate = 2e-5 num_train_epochs = 3 weight_decay = 0.01
model = AutoModelForTokenClassification.from_pretrained("akdeniz27/bert-base-turkish-cased-ner") tokenizer = AutoTokenizer.from_pretrained("akdeniz27/bert-base-turkish-cased-ner") ner = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="first") ner("your text here")
请参考" https://huggingface.co/transformers/_modules/transformers/pipelines/token_classification.html" "以了解带有聚合策略参数的实体分组。