Spaces:
Runtime error
Runtime error
Commit
·
11c2ed7
1
Parent(s):
681036b
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,10 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
return pipe(text)[0]["translation_text"]
|
| 9 |
-
|
| 10 |
-
demo = gr.Interface(
|
| 11 |
-
fn=predict,
|
| 12 |
-
inputs='text',
|
| 13 |
-
outputs='text',
|
| 14 |
-
)
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
| 1 |
+
!pip install transformers
|
| 2 |
+
import transformers
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
+
unmasker = pipeline('fill-mask', model='bert-large-uncased')
|
| 6 |
+
user_input = input("Enter a sentence with a masked word: ")
|
| 7 |
+
results = unmasker(user_input)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
for result in results:
|
| 10 |
+
print(result['sequence'])
|