DHRUV SHEKHAWAT commited on
Commit
d524505
·
1 Parent(s): bc2a7e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -48,6 +48,10 @@ st.subheader("Enter the text you'd like to analyze.")
48
  text = st.text_input('Enter word: ') #text is stored in this variable
49
 
50
  if option == '1':
 
 
 
 
51
  loaded_dict = np.load("dict_predict3.bin.npz", allow_pickle=True)
52
  word_to_num = loaded_dict["word_to_num"].item()
53
  num_to_word = loaded_dict["num_to_word"].item()
 
48
  text = st.text_input('Enter word: ') #text is stored in this variable
49
 
50
  if option == '1':
51
+ with open("data3.txt","r") as f:
52
+ text = f.read()
53
+ text = text.lower()
54
+ words = text.split()
55
  loaded_dict = np.load("dict_predict3.bin.npz", allow_pickle=True)
56
  word_to_num = loaded_dict["word_to_num"].item()
57
  num_to_word = loaded_dict["num_to_word"].item()