Views
No views yet

| lang_id (Adapter index) | Language code | Language |
|---|---|---|
| 0 | de_CH | Swiss Standard German |
| 1 | fr_CH | French |
| 2 | it_CH | Italian |
| 3 | rm_CH | Romansh Grischun |
| 4 | gsw | Swiss German |
1from transformers import pipeline
2
3fill_mask = pipeline(model="ZurichNLP/swissbert")1fill_mask.model.set_default_language("de_CH")
2fill_mask("Der schönste Kanton der Schweiz ist <mask>.")[{'score': 0.1373230218887329,
'token': 331,
'token_str': 'Zürich',
'sequence': 'Der schönste Kanton der Schweiz ist Zürich.'},
{'score': 0.08464793860912323,
'token': 5903,
'token_str': 'Appenzell',
'sequence': 'Der schönste Kanton der Schweiz ist Appenzell.'},
{'score': 0.08250337839126587,
'token': 10800,
'token_str': 'Graubünden',
'sequence': 'Der schönste Kanton der Schweiz ist Graubünden.'},
...]1fill_mask.model.set_default_language("fr_CH")
2fill_mask("Je m'appelle <mask> Federer.")[{'score': 0.9943694472312927,
'token': 1371,
'token_str': 'Roger',
'sequence': "Je m'appelle Roger Federer."},
...]1@inproceedings{vamvas-etal-2023-swissbert,
2 title = "{S}wiss{BERT}: The Multilingual Language Model for {S}witzerland",
3 author = {Vamvas, Jannis and
4 Gra{\"e}n, Johannes and
5 Sennrich, Rico},
6 editor = {Ghorbel, Hatem and
7 Sokhn, Maria and
8 Cieliebak, Mark and
9 H{\"u}rlimann, Manuela and
10 de Salis, Emmanuel and
11 Guerne, Jonathan},
12 booktitle = "Proceedings of the 8th edition of the Swiss Text Analytics Conference",
13 month = jun,
14 year = "2023",
15 address = "Neuchatel, Switzerland",
16 publisher = "Association for Computational Linguistics",
17 url = "https://aclanthology.org/2023.swisstext-1.6",
18 pages = "54--69",
19}1@inproceedings{vamvas-etal-2024-modular,
2 title={Modular Adaptation of Multilingual Encoders to Written Swiss German Dialect},
3 author={Jannis Vamvas and No{\"e}mi Aepli and Rico Sennrich},
4 booktitle={First Workshop on Modular and Open Multilingual NLP},
5 year={2024},
6}