Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,34 +47,61 @@ if choice == 'টেক্সট ইনপুট':
|
|
| 47 |
my_list.append(tuple(word))
|
| 48 |
annotated_text(my_list)
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
if choice == 'ফাইল আপলোড':
|
| 51 |
uploaded_files = st.file_uploader("Choose a CSV file")
|
| 52 |
|
| 53 |
-
for uploaded_file in uploaded_files:
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
| 61 |
-
for index, row in dataframe.iterrows():
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
|
| 79 |
|
| 80 |
|
|
|
|
| 47 |
my_list.append(tuple(word))
|
| 48 |
annotated_text(my_list)
|
| 49 |
|
| 50 |
+
# if choice == 'ফাইল আপলোড':
|
| 51 |
+
# uploaded_files = st.file_uploader("Choose a CSV file")
|
| 52 |
+
|
| 53 |
+
# for uploaded_file in uploaded_files:
|
| 54 |
+
# bytes_data = uploaded_file.read()
|
| 55 |
+
# # st.write("filename:", uploaded_file.name)
|
| 56 |
+
# search_word_def = uploaded_file.name.split('.')[0].split(' ')[-1]
|
| 57 |
+
# dataframe = pd.read_excel(uploaded_file)
|
| 58 |
+
# # model = load_model('best-model-002.pt')
|
| 59 |
+
|
| 60 |
+
# # st.write(dataframe)
|
| 61 |
+
# for index, row in dataframe.iterrows():
|
| 62 |
+
# # st.write(index)
|
| 63 |
+
# # st.write(row['Unnamed: 2'])
|
| 64 |
+
# if pd.notnull(row['Unnamed: 2']):
|
| 65 |
+
# data = BasicTokenizer().tokenize(row['Unnamed: 2'])
|
| 66 |
+
# sentence = Sentence(data)
|
| 67 |
+
# model.predict(sentence)
|
| 68 |
+
|
| 69 |
+
# # st.write(sentence)
|
| 70 |
+
# my_list = []
|
| 71 |
+
# for token in sentence:
|
| 72 |
+
# word = []
|
| 73 |
+
# word.append(token.text)
|
| 74 |
+
# word.append(token.tag)
|
| 75 |
+
# my_list.append("/".join(tuple(word)))
|
| 76 |
+
# # st.write(" ".join(my_list))
|
| 77 |
+
|
| 78 |
if choice == 'ফাইল আপলোড':
|
| 79 |
uploaded_files = st.file_uploader("Choose a CSV file")
|
| 80 |
|
| 81 |
+
# for uploaded_file in uploaded_files:
|
| 82 |
+
bytes_data = uploaded_files.read()
|
| 83 |
+
# st.write("filename:", uploaded_file.name)
|
| 84 |
+
search_word_def = uploaded_files.name.split('.')[0].split(' ')[-1]
|
| 85 |
+
dataframe = pd.read_excel(uploaded_files)
|
| 86 |
+
# model = load_model('best-model-002.pt')
|
| 87 |
|
| 88 |
+
st.write(dataframe)
|
| 89 |
+
# for index, row in dataframe.iterrows():
|
| 90 |
+
# # st.write(index)
|
| 91 |
+
# # st.write(row['Unnamed: 2'])
|
| 92 |
+
# if pd.notnull(row['Unnamed: 2']):
|
| 93 |
+
# data = BasicTokenizer().tokenize(row['Unnamed: 2'])
|
| 94 |
+
# sentence = Sentence(data)
|
| 95 |
+
# model.predict(sentence)
|
| 96 |
|
| 97 |
+
# # st.write(sentence)
|
| 98 |
+
# my_list = []
|
| 99 |
+
# for token in sentence:
|
| 100 |
+
# word = []
|
| 101 |
+
# word.append(token.text)
|
| 102 |
+
# word.append(token.tag)
|
| 103 |
+
# my_list.append("/".join(tuple(word)))
|
| 104 |
+
# # st.write(" ".join(my_list))
|
|
|
|
| 105 |
|
| 106 |
|
| 107 |
|