Spaces:
Sleeping
Sleeping
Commit
·
f8fa791
1
Parent(s):
c8cc09f
progress more 38+
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ def create_analysis_data(df):
|
|
| 29 |
analysis_data = []
|
| 30 |
for _, row in df.iterrows():
|
| 31 |
if any(row[model] == 'Negative' for model in ['FinBERT', 'RoBERTa', 'FinBERT-Tone']):
|
| 32 |
-
analysis_data.append([row['Объект'], 'РИСК УБЫТКА',
|
| 33 |
return pd.DataFrame(analysis_data, columns=['Объект', 'Тип риска', 'Заголовок', 'Текст'])
|
| 34 |
|
| 35 |
# Function for lemmatizing Russian text
|
|
@@ -201,11 +201,12 @@ def create_output_file(df, uploaded_file, analysis_df):
|
|
| 201 |
ws.cell(row=r_idx, column=c_idx, value=value)
|
| 202 |
|
| 203 |
# Process data for 'Значимые' sheet
|
|
|
|
| 204 |
significant_data = []
|
| 205 |
for _, row in df.iterrows():
|
| 206 |
if any(row[model] in ['Negative', 'Positive'] for model in ['FinBERT', 'RoBERTa', 'FinBERT-Tone']):
|
| 207 |
sentiment = 'Negative' if any(row[model] == 'Negative' for model in ['FinBERT', 'RoBERTa', 'FinBERT-Tone']) else 'Positive'
|
| 208 |
-
significant_data.append([row['Объект'], sentiment, row['Заголовок'], row['Выдержки из текста']])
|
| 209 |
|
| 210 |
# Write 'Значимые' sheet
|
| 211 |
ws = wb['Значимые']
|
|
|
|
| 29 |
analysis_data = []
|
| 30 |
for _, row in df.iterrows():
|
| 31 |
if any(row[model] == 'Negative' for model in ['FinBERT', 'RoBERTa', 'FinBERT-Tone']):
|
| 32 |
+
analysis_data.append([row['Объект'], row['Заголовок'], 'РИСК УБЫТКА', '', row['Выдержки из текста']])
|
| 33 |
return pd.DataFrame(analysis_data, columns=['Объект', 'Тип риска', 'Заголовок', 'Текст'])
|
| 34 |
|
| 35 |
# Function for lemmatizing Russian text
|
|
|
|
| 201 |
ws.cell(row=r_idx, column=c_idx, value=value)
|
| 202 |
|
| 203 |
# Process data for 'Значимые' sheet
|
| 204 |
+
|
| 205 |
significant_data = []
|
| 206 |
for _, row in df.iterrows():
|
| 207 |
if any(row[model] in ['Negative', 'Positive'] for model in ['FinBERT', 'RoBERTa', 'FinBERT-Tone']):
|
| 208 |
sentiment = 'Negative' if any(row[model] == 'Negative' for model in ['FinBERT', 'RoBERTa', 'FinBERT-Tone']) else 'Positive'
|
| 209 |
+
significant_data.append([row['Объект'], '', sentiment, '', row['Заголовок'], row['Выдержки из текста']])
|
| 210 |
|
| 211 |
# Write 'Значимые' sheet
|
| 212 |
ws = wb['Значимые']
|