Spaces:
Build error
Build error
Commit ·
1d3bde8
1
Parent(s): 2c93116
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,27 +3,21 @@ import os
|
|
| 3 |
import git
|
| 4 |
if(os.path.isdir("./TickerExtraction")==False):
|
| 5 |
git.Git("./").clone("https://huggingface.co/rajaatif786/TickerExtraction")
|
| 6 |
-
st.write("completed")
|
| 7 |
print(os.path.exists("rajaatif786/TickerExtraction/entity_model2.pt"))
|
| 8 |
st.write(os.listdir("./TickerExtraction/"))
|
| 9 |
-
import streamlit as st
|
| 10 |
-
|
| 11 |
x = st.slider('Select a value')
|
| 12 |
st.write(x, 'squared is', x * x)
|
| 13 |
|
| 14 |
-
import os
|
| 15 |
import pandas as pd
|
| 16 |
import numpy as np
|
| 17 |
-
#device="cpu"
|
| 18 |
os.chdir("./TickerExtraction")
|
| 19 |
from EntityExtractor import EntityDataset, EntityBertNet,BertEntityExtractor, LABEL_MAP
|
| 20 |
entity_extractor = BertEntityExtractor.load_trained_model()
|
| 21 |
import nltk
|
| 22 |
nltk.download('stopwords')
|
| 23 |
-
texts=["nokia"]
|
| 24 |
-
#print(make_prediction(texts))
|
| 25 |
|
| 26 |
-
|
|
|
|
| 27 |
st.write(texts[0])
|
| 28 |
data,df=entity_extractor.input_text(texts)
|
| 29 |
probs = entity_extractor.extract_entity_probabilities( dataset=data)
|
|
|
|
| 3 |
import git
|
| 4 |
if(os.path.isdir("./TickerExtraction")==False):
|
| 5 |
git.Git("./").clone("https://huggingface.co/rajaatif786/TickerExtraction")
|
|
|
|
| 6 |
print(os.path.exists("rajaatif786/TickerExtraction/entity_model2.pt"))
|
| 7 |
st.write(os.listdir("./TickerExtraction/"))
|
|
|
|
|
|
|
| 8 |
x = st.slider('Select a value')
|
| 9 |
st.write(x, 'squared is', x * x)
|
| 10 |
|
|
|
|
| 11 |
import pandas as pd
|
| 12 |
import numpy as np
|
|
|
|
| 13 |
os.chdir("./TickerExtraction")
|
| 14 |
from EntityExtractor import EntityDataset, EntityBertNet,BertEntityExtractor, LABEL_MAP
|
| 15 |
entity_extractor = BertEntityExtractor.load_trained_model()
|
| 16 |
import nltk
|
| 17 |
nltk.download('stopwords')
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
|
| 20 |
+
texts=[st.text_input("Enter Text")]
|
| 21 |
st.write(texts[0])
|
| 22 |
data,df=entity_extractor.input_text(texts)
|
| 23 |
probs = entity_extractor.extract_entity_probabilities( dataset=data)
|