Dagobert42
commited on
Commit
•
ec77f50
1
Parent(s):
3b57a52
edit gitignore
Browse files- .gitignore +1 -0
- app.py +6 -4
- helpers.py +1 -13
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
__pycache__
|
app.py
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
-
import torch
|
2 |
import streamlit as st
|
3 |
from random import choice
|
4 |
from annotated_text import annotated_text
|
|
|
5 |
from helpers import *
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
10 |
|
11 |
st.title("Semantic Frame Augmentation")
|
12 |
st.subheader("Analysing difficult low-resource domains with only a handful of examples")
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from random import choice
|
3 |
from annotated_text import annotated_text
|
4 |
+
from resources import *
|
5 |
from helpers import *
|
6 |
|
7 |
+
base_model = "xlnet-base-cased"
|
8 |
+
session = load_variables()
|
9 |
+
sentences = load_sentences()
|
10 |
+
baseline_classifier = load_model(f"Dagobert42/{base_model}-biored-finetuned")
|
11 |
+
augmented_classifier = load_model(f"Dagobert42/{base_model}-biored-augmented")
|
12 |
|
13 |
st.title("Semantic Frame Augmentation")
|
14 |
st.subheader("Analysing difficult low-resource domains with only a handful of examples")
|
helpers.py
CHANGED
@@ -1,16 +1,4 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
baseline_classifier = pipeline("ner",
|
4 |
-
model="Dagobert42/xlnet-base-cased-biored-augmented",
|
5 |
-
aggregation_strategy="average"
|
6 |
-
)
|
7 |
-
augmented_classifier = pipeline("ner",
|
8 |
-
model="Dagobert42/xlnet-base-cased-biored-finetuned",
|
9 |
-
aggregation_strategy="average"
|
10 |
-
)
|
11 |
-
|
12 |
-
def annotate_sentence(sentence, predictions):
|
13 |
-
colors = {
|
14 |
'GeneOrGeneProduct': '#aad4aa', # Pastel green
|
15 |
'DiseaseOrPhenotypicFeature': '#f8b400', # Pastel orange
|
16 |
'ChemicalEntity': '#a4c2f4', # Pastel blue
|
|
|
1 |
+
colors = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
'GeneOrGeneProduct': '#aad4aa', # Pastel green
|
3 |
'DiseaseOrPhenotypicFeature': '#f8b400', # Pastel orange
|
4 |
'ChemicalEntity': '#a4c2f4', # Pastel blue
|