Views
No views yet
1@article{conneau2019unsupervised,
2 title={Unsupervised Cross-lingual Representation Learning at Scale},
3 author={Conneau, Alexis and Khandelwal, Kartikay and Goyal, Naman and Chaudhary, Vishrav and Wenzek, Guillaume and Guzm{\'a}n, Francisco and Grave, Edouard and Ott, Myle and Zettlemoyer, Luke and Stoyanov, Veselin},
4 journal={arXiv preprint arXiv:1911.02116},
5 year={2019}
6}1>>> from transformers import AutoTokenizer, AutoModelForTokenClassification
2>>> from transformers import pipeline
3>>> tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large-finetuned-conll03-german")
4>>> model = AutoModelForTokenClassification.from_pretrained("xlm-roberta-large-finetuned-conll03-german")
5>>> classifier = pipeline("ner", model=model, tokenizer=tokenizer)
6>>> classifier("Bayern München ist wieder alleiniger Top-Favorit auf den Gewinn der deutschen Fußball-Meisterschaft.")
7
8[{'end': 6,
9 'entity': 'I-ORG',
10 'index': 1,
11 'score': 0.99999166,
12 'start': 0,
13 'word': '▁Bayern'},
14 {'end': 14,
15 'entity': 'I-ORG',
16 'index': 2,
17 'score': 0.999987,
18 'start': 7,
19 'word': '▁München'},
20 {'end': 77,
21 'entity': 'I-MISC',
22 'index': 16,
23 'score': 0.9999728,
24 'start': 68,
25 'word': '▁deutschen'}]