Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -32,14 +32,11 @@ except:
|
|
| 32 |
def perform_asde_inference(text, dataset, model_id):
|
| 33 |
if not text:
|
| 34 |
df = pd.read_csv('pyabsa_english.csv')
|
| 35 |
-
print(type(df))
|
| 36 |
-
print(df.head(2))
|
| 37 |
random_i = np.random.randint(low=0, high=df.shape[0], size=(1,)).flat[0]
|
| 38 |
-
print(random_i)
|
| 39 |
selected_df = df.iloc[random_i]
|
| 40 |
-
text = selected_df['clean_text'].iloc[0]
|
| 41 |
-
true_aspect = selected_df['actual_aspects'].iloc[0]
|
| 42 |
-
true_sentiment = selected_df['actual_sentiments'].iloc[0]
|
| 43 |
|
| 44 |
|
| 45 |
bos_instruction = """Definition: The output will be the aspects (both implicit and explicit) and the aspects sentiment polarity. In cases where there are no aspects the output should be noaspectterm:none.
|
|
|
|
| 32 |
def perform_asde_inference(text, dataset, model_id):
|
| 33 |
if not text:
|
| 34 |
df = pd.read_csv('pyabsa_english.csv')
|
|
|
|
|
|
|
| 35 |
random_i = np.random.randint(low=0, high=df.shape[0], size=(1,)).flat[0]
|
|
|
|
| 36 |
selected_df = df.iloc[random_i]
|
| 37 |
+
text = str(selected_df['clean_text'].iloc[0])
|
| 38 |
+
true_aspect = str(selected_df['actual_aspects'].iloc[0])
|
| 39 |
+
true_sentiment = str(selected_df['actual_sentiments'].iloc[0])
|
| 40 |
|
| 41 |
|
| 42 |
bos_instruction = """Definition: The output will be the aspects (both implicit and explicit) and the aspects sentiment polarity. In cases where there are no aspects the output should be noaspectterm:none.
|