atanu0491 commited on
Commit
f4ef5b0
·
1 Parent(s): 9744de6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -26,7 +26,7 @@ if choice == 'Text Input':
26
  input_data = st.text_area("Enter bengali text", value="", height=10)
27
  if st.button('Process'):
28
  # '''
29
- # data = BasicTokenizer().tokenize(input_data)
30
 
31
  # fl = open('bengali_pos/test.txt', 'w')
32
  # for i in data:
@@ -37,10 +37,10 @@ if choice == 'Text Input':
37
  # columns = {0: 'text'}
38
  # corpus: Corpus = ColumnCorpus('bengali_pos/', columns, train_file='train.txt', test_file='test.txt', dev_file='valid.txt')
39
  # '''
40
- sentence = Sentence(input_data)
41
  model = load_model('best-model-002.pt')
42
  model.predict(sentence)
43
- st.write(sentence[1])
44
 
45
  #print(input_data.to_tagged_string())
46
  #result_mean = model.evaluate(corpus.test, gold_label_type='pos',mini_batch_size=32, out_path=f"pred_pos.txt")
 
26
  input_data = st.text_area("Enter bengali text", value="", height=10)
27
  if st.button('Process'):
28
  # '''
29
+ data = BasicTokenizer().tokenize(input_data)
30
 
31
  # fl = open('bengali_pos/test.txt', 'w')
32
  # for i in data:
 
37
  # columns = {0: 'text'}
38
  # corpus: Corpus = ColumnCorpus('bengali_pos/', columns, train_file='train.txt', test_file='test.txt', dev_file='valid.txt')
39
  # '''
40
+ sentence = Sentence(data)
41
  model = load_model('best-model-002.pt')
42
  model.predict(sentence)
43
+ st.write(sentence)
44
 
45
  #print(input_data.to_tagged_string())
46
  #result_mean = model.evaluate(corpus.test, gold_label_type='pos',mini_batch_size=32, out_path=f"pred_pos.txt")