Spaces:
Runtime error
Runtime error
File size: 509 Bytes
58f2a4f bf022fc 7337250 8486efa f76cd25 7ee86f4 7337250 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from transformers import pipeline
import streamlit as st
unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
def main():
st.title('EN sentence mask filling')
st.markdown('Mask a word with [MASK]. For example, **I [MASK] dog for a walk**')
masked = st.text_input('Masked sentence','Please insert a sentence')
if '[MASK]' is in masked.split(' '):
output = unmasker(masked)
else:
print('Sentence is not masked!!!')
if __name__ == "__main__":
main() |