Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,14 @@ from transformers import pipeline
|
|
4 |
BASE_MODEL = "nlpaueb/legal-bert-base-uncased"
|
5 |
|
6 |
mask_filler = pipeline("fill-mask", model=BASE_MODEL)
|
|
|
7 |
|
8 |
def mask_fill(text):
|
9 |
-
preds = mask_filler(text)
|
10 |
-
|
|
|
|
|
|
|
11 |
|
12 |
gradio_ui = gr.Interface(
|
13 |
fn=mask_fill,
|
4 |
BASE_MODEL = "nlpaueb/legal-bert-base-uncased"
|
5 |
|
6 |
mask_filler = pipeline("fill-mask", model=BASE_MODEL)
|
7 |
+
k = []
|
8 |
|
9 |
def mask_fill(text):
|
10 |
+
preds = mask_filler(text)
|
11 |
+
for pred in preds:
|
12 |
+
k.append(pred["sequence"])
|
13 |
+
final_string = '\n'.join(k)
|
14 |
+
return final_string
|
15 |
|
16 |
gradio_ui = gr.Interface(
|
17 |
fn=mask_fill,
|