Cicciokr's picture
init change latin bert
21c571e verified
raw
history blame
582 Bytes
#import streamlit as st
#x = st.slider('Select a value')
#st.write(x, 'squared is', x * x)
from transformers import pipeline, BertForQuestionAnswering, AutoTokenizer
modelname = 'models/latin_bert'
model = BertForQuestionAnswering.from_pretrained(modelname)
# Creare un pipeline di riempimento maschere
tokenizer = AutoTokenizer.from_pretrained(modelname)
fill_mask = pipeline("fill-mask", model=model, tokenizer=tokenizer)
# Testare il modello
frase = "Gallia est omnis divisa in [MASK] tres."
output = fill_mask(frase)
for risultato in output:
st.write(risultato["sequence"])