Spaces:
Runtime error
Runtime error
jaifar530
commited on
sdadsa
Browse files
app.py
CHANGED
|
@@ -30,9 +30,9 @@ nltk.download('stopwords')
|
|
| 30 |
nltk.download('averaged_perceptron_tagger')
|
| 31 |
|
| 32 |
# Check if the file exists
|
| 33 |
-
if not os.path.isfile('
|
| 34 |
# Download the zip file if it doesn't exist
|
| 35 |
-
url = 'https://jaifar.net/
|
| 36 |
headers = {
|
| 37 |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
|
| 38 |
}
|
|
@@ -40,14 +40,13 @@ if not os.path.isfile('RandomForestClassifier.pkl'):
|
|
| 40 |
response = requests.get(url, headers=headers)
|
| 41 |
|
| 42 |
# Save the file
|
| 43 |
-
with open('
|
| 44 |
file.write(response.content)
|
| 45 |
|
| 46 |
# At this point, the pickle file should exist, either it was already there, or it has been downloaded and extracted.
|
| 47 |
with open('RandomForestClassifier.pkl', 'rb') as file:
|
| 48 |
clf_loaded = pickle.load(file)
|
| 49 |
|
| 50 |
-
|
| 51 |
input_paragraph = st.text_area("Input your text here")
|
| 52 |
words_counts = word_tokenize(input_paragraph)
|
| 53 |
final_words = len(words_counts)
|
|
|
|
| 30 |
nltk.download('averaged_perceptron_tagger')
|
| 31 |
|
| 32 |
# Check if the file exists
|
| 33 |
+
if not os.path.isfile('AI_vs_AI_RandomForest_88_Samples.pkl'):
|
| 34 |
# Download the zip file if it doesn't exist
|
| 35 |
+
url = 'https://jaifar.net/AI_vs_AI_RandomForest_88_Samples.pkl'
|
| 36 |
headers = {
|
| 37 |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
|
| 38 |
}
|
|
|
|
| 40 |
response = requests.get(url, headers=headers)
|
| 41 |
|
| 42 |
# Save the file
|
| 43 |
+
with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'wb') as file:
|
| 44 |
file.write(response.content)
|
| 45 |
|
| 46 |
# At this point, the pickle file should exist, either it was already there, or it has been downloaded and extracted.
|
| 47 |
with open('RandomForestClassifier.pkl', 'rb') as file:
|
| 48 |
clf_loaded = pickle.load(file)
|
| 49 |
|
|
|
|
| 50 |
input_paragraph = st.text_area("Input your text here")
|
| 51 |
words_counts = word_tokenize(input_paragraph)
|
| 52 |
final_words = len(words_counts)
|