Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
3 |
from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer
|
4 |
-
from streamlit_extras.app_logo import add_logo
|
5 |
-
|
6 |
-
def logo():
|
7 |
-
add_logo("vocali_logo.jpeg", height=300)
|
8 |
-
|
9 |
|
10 |
def get_result_text_es_pt (list_entity, text, lang):
|
11 |
result_words = []
|
@@ -103,7 +98,6 @@ def get_result_text_ca (list_entity, text):
|
|
103 |
|
104 |
if __name__ == "__main__":
|
105 |
|
106 |
-
logo()
|
107 |
st.title('Sanivert Punctuation And Capitalization Restoration')
|
108 |
model_es = AutoModelForTokenClassification.from_pretrained("VOCALINLP/spanish_capitalization_punctuation_restoration_sanivert")
|
109 |
tokenizer_es = AutoTokenizer.from_pretrained("VOCALINLP/spanish_capitalization_punctuation_restoration_sanivert")
|
@@ -116,7 +110,9 @@ if __name__ == "__main__":
|
|
116 |
model_pt = AutoModelForTokenClassification.from_pretrained("VOCALINLP/portuguese_capitalization_punctuation_restoration_sanivert")
|
117 |
tokenizer_pt = AutoTokenizer.from_pretrained("VOCALINLP/portuguese_capitalization_punctuation_restoration_sanivert")
|
118 |
pipe_pt = pipeline("token-classification", model=model_ca, tokenizer=tokenizer_ca)
|
119 |
-
|
|
|
|
|
120 |
input_text = st.selectbox(
|
121 |
label = "Choose an language",
|
122 |
options = ["Spanish", "Portuguese", "Catalan"]
|
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
3 |
from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
def get_result_text_es_pt (list_entity, text, lang):
|
6 |
result_words = []
|
|
|
98 |
|
99 |
if __name__ == "__main__":
|
100 |
|
|
|
101 |
st.title('Sanivert Punctuation And Capitalization Restoration')
|
102 |
model_es = AutoModelForTokenClassification.from_pretrained("VOCALINLP/spanish_capitalization_punctuation_restoration_sanivert")
|
103 |
tokenizer_es = AutoTokenizer.from_pretrained("VOCALINLP/spanish_capitalization_punctuation_restoration_sanivert")
|
|
|
110 |
model_pt = AutoModelForTokenClassification.from_pretrained("VOCALINLP/portuguese_capitalization_punctuation_restoration_sanivert")
|
111 |
tokenizer_pt = AutoTokenizer.from_pretrained("VOCALINLP/portuguese_capitalization_punctuation_restoration_sanivert")
|
112 |
pipe_pt = pipeline("token-classification", model=model_ca, tokenizer=tokenizer_ca)
|
113 |
+
|
114 |
+
st.sidebar.image("vocali_logo.jpg")
|
115 |
+
|
116 |
input_text = st.selectbox(
|
117 |
label = "Choose an language",
|
118 |
options = ["Spanish", "Portuguese", "Catalan"]
|