Views
No views yet
1from transformers import pipeline
2
3
4afroscope_model = pipeline("text-classification", model='UBC-NLP/afroscope-model')
5
6input_text="Ninyepuní íne εtɩε, bε ewǐe Jesi ɔnʋ lεfε kʋkʋkpɔ cε."
7
8result = afroscope_model(input_text)
9
10# Extract the label and score from the first result
11language = result[0]['label']
12score = result[0]['score']
13
14print(f"detected langauge: {language}\tscore: {round(score*100, 2)}")
151@article{kwon2026afroscope,
2 title={AfroScope: A Framework for Studying the Linguistic Landscape of Africa},
3 author={Kwon, Sang Yun and Elmadany, AbdelRahim and Abdul-Mageed, Muhammad},
4 journal={arXiv preprint arXiv:2601.13346},
5 year={2026}
6}