Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ dataset_iter = load_dataset(
|
|
| 12 |
).shuffle(seed=42) # Shuffle added
|
| 13 |
|
| 14 |
# Load the model
|
| 15 |
-
model = GLiNER.from_pretrained("
|
| 16 |
|
| 17 |
def ner(text: str, labels: str, threshold: float, nested_ner: bool):
|
| 18 |
# Convert user-provided labels (comma-separated string) into a list
|
|
@@ -44,7 +44,7 @@ with gr.Blocks(title="General NER with Color-Coded Output") as demo:
|
|
| 44 |
|
| 45 |
# Display a random example
|
| 46 |
input_text = gr.Textbox(
|
| 47 |
-
value="
|
| 48 |
label="Text input",
|
| 49 |
placeholder="Enter your text here",
|
| 50 |
lines=5
|
|
@@ -52,7 +52,7 @@ with gr.Blocks(title="General NER with Color-Coded Output") as demo:
|
|
| 52 |
|
| 53 |
with gr.Row() as row:
|
| 54 |
labels = gr.Textbox(
|
| 55 |
-
value="
|
| 56 |
label="Labels",
|
| 57 |
placeholder="Enter your labels here (comma separated)",
|
| 58 |
scale=2,
|
|
|
|
| 12 |
).shuffle(seed=42) # Shuffle added
|
| 13 |
|
| 14 |
# Load the model
|
| 15 |
+
model = GLiNER.from_pretrained("urchade/gliner_multi-v2.1", trust_remote_code=True)
|
| 16 |
|
| 17 |
def ner(text: str, labels: str, threshold: float, nested_ner: bool):
|
| 18 |
# Convert user-provided labels (comma-separated string) into a list
|
|
|
|
| 44 |
|
| 45 |
# Display a random example
|
| 46 |
input_text = gr.Textbox(
|
| 47 |
+
value="Click 'Get New Snippet' to load a random sample from the British Library Dataset",
|
| 48 |
label="Text input",
|
| 49 |
placeholder="Enter your text here",
|
| 50 |
lines=5
|
|
|
|
| 52 |
|
| 53 |
with gr.Row() as row:
|
| 54 |
labels = gr.Textbox(
|
| 55 |
+
value="People, Places", # Default example labels
|
| 56 |
label="Labels",
|
| 57 |
placeholder="Enter your labels here (comma separated)",
|
| 58 |
scale=2,
|