Milad Alshomary
commited on
Commit
·
d8b3dc8
1
Parent(s):
a5e49c0
fixes
Browse files
baseline_static_explanations.py
CHANGED
|
@@ -81,22 +81,22 @@ def generate_explanations(args):
|
|
| 81 |
for instance in instances_for_ex:
|
| 82 |
json_obj = {}
|
| 83 |
json_obj['Q_authorID'] = instance['Q_authorID']
|
| 84 |
-
json_obj['Q_fullText'] = instance['Q_fullText']
|
| 85 |
style_descirption, q_embeddings = find_closest_cluster_style(instance['Q_fullText'], interp_space, model_name=model_name)
|
| 86 |
json_obj['Q_top_style_feats'] = style_descirption
|
| 87 |
|
| 88 |
json_obj['a0_authorID'] = instance['a0_authorID']
|
| 89 |
-
json_obj['a0_fullText'] = instance['a0_fullText']
|
| 90 |
style_descirption, a0_embeddings = find_closest_cluster_style(instance['a0_fullText'], interp_space, model_name=model_name)
|
| 91 |
json_obj['a0_top_style_feats'] = style_descirption
|
| 92 |
|
| 93 |
json_obj['a1_authorID'] = instance['a1_authorID']
|
| 94 |
-
json_obj['a1_fullText'] = instance['a1_fullText']
|
| 95 |
style_descirption, a1_embeddings = find_closest_cluster_style(instance['a1_fullText'], interp_space, model_name=model_name)
|
| 96 |
json_obj['a1_top_style_feats'] = style_descirption
|
| 97 |
|
| 98 |
json_obj['a2_authorID'] = instance['a2_authorID']
|
| 99 |
-
json_obj['a2_fullText'] = instance['a2_fullText']
|
| 100 |
style_descirption, a2_embeddings = find_closest_cluster_style(instance['a2_fullText'], interp_space, model_name=model_name)
|
| 101 |
json_obj['a2_top_style_feats'] = style_descirption
|
| 102 |
|
|
|
|
| 81 |
for instance in instances_for_ex:
|
| 82 |
json_obj = {}
|
| 83 |
json_obj['Q_authorID'] = instance['Q_authorID']
|
| 84 |
+
json_obj['Q_fullText'] = '\n\n'.join(instance['Q_fullText'])
|
| 85 |
style_descirption, q_embeddings = find_closest_cluster_style(instance['Q_fullText'], interp_space, model_name=model_name)
|
| 86 |
json_obj['Q_top_style_feats'] = style_descirption
|
| 87 |
|
| 88 |
json_obj['a0_authorID'] = instance['a0_authorID']
|
| 89 |
+
json_obj['a0_fullText'] = '\n\n'.join(instance['a0_fullText'])
|
| 90 |
style_descirption, a0_embeddings = find_closest_cluster_style(instance['a0_fullText'], interp_space, model_name=model_name)
|
| 91 |
json_obj['a0_top_style_feats'] = style_descirption
|
| 92 |
|
| 93 |
json_obj['a1_authorID'] = instance['a1_authorID']
|
| 94 |
+
json_obj['a1_fullText'] = '\n\n'.join(instance['a1_fullText'])
|
| 95 |
style_descirption, a1_embeddings = find_closest_cluster_style(instance['a1_fullText'], interp_space, model_name=model_name)
|
| 96 |
json_obj['a1_top_style_feats'] = style_descirption
|
| 97 |
|
| 98 |
json_obj['a2_authorID'] = instance['a2_authorID']
|
| 99 |
+
json_obj['a2_fullText'] = '\n\n'.join(instance['a2_fullText'])
|
| 100 |
style_descirption, a2_embeddings = find_closest_cluster_style(instance['a2_fullText'], interp_space, model_name=model_name)
|
| 101 |
json_obj['a2_top_style_feats'] = style_descirption
|
| 102 |
|