Spaces:
Sleeping
Sleeping
jaifar530
commited on
fix words count
Browse files
app.py
CHANGED
@@ -49,7 +49,8 @@ with open('RandomForestClassifier.pkl', 'rb') as file:
|
|
49 |
|
50 |
input_paragraph = st.text_area("Input your text here")
|
51 |
words_counts = word_tokenize(input_paragraph)
|
52 |
-
|
|
|
53 |
|
54 |
|
55 |
|
@@ -115,7 +116,7 @@ def extract_features(text):
|
|
115 |
|
116 |
|
117 |
# Creates a button named 'Press me'
|
118 |
-
press_me_button = st.button("
|
119 |
|
120 |
if press_me_button:
|
121 |
input_features = df['paragraph'].apply(extract_features)
|
|
|
49 |
|
50 |
input_paragraph = st.text_area("Input your text here")
|
51 |
words_counts = word_tokenize(input_paragraph)
|
52 |
+
final_words = sum(len(words_count) for words_count in words_counts)
|
53 |
+
st.write('Words counts: ', final_words)
|
54 |
|
55 |
|
56 |
|
|
|
116 |
|
117 |
|
118 |
# Creates a button named 'Press me'
|
119 |
+
press_me_button = st.button("Which Model Used?")
|
120 |
|
121 |
if press_me_button:
|
122 |
input_features = df['paragraph'].apply(extract_features)
|