Views
No views yet
pip install transformers
pip install torch
1import unicodedata
2
3def preprocess(text):
4 text = text.lower()
5 text = unicodedata.normalize('NFD',text).translate({ord('\N{COMBINING ACUTE ACCENT}'):None})
6 return text1from transformers import AutoTokenizer, AutoModelForMaskedLM
2
3tokenizer = AutoTokenizer.from_pretrained("pchatz/greeksocialbert-base-greek-social-media-v2")
4
5model = AutoModelForMaskedLM.from_pretrained("pchatz/greeksocialbert-base-greek-social-media-v2")1from transformers import pipeline
2
3fill = pipeline('fill-mask', model=model, tokenizer=tokenizer)
4fill(f'μεσα {fill.tokenizer.mask_token} δικτυωσης')1
2@Article{info12080331,
3AUTHOR = {Alexandridis, Georgios and Varlamis, Iraklis and Korovesis, Konstantinos and Caridakis, George and Tsantilas, Panagiotis},
4TITLE = {A Survey on Sentiment Analysis and Opinion Mining in Greek Social Media},
5JOURNAL = {Information},
6VOLUME = {12},
7YEAR = {2021},
8NUMBER = {8},
9ARTICLE-NUMBER = {331},
10URL = {https://www.mdpi.com/2078-2489/12/8/331},
11ISSN = {2078-2489},
12DOI = {10.3390/info12080331}
13}