alverciito commited on
Commit
edbcb21
·
1 Parent(s): 00f1b20

zero-shot benchmark

Browse files
research_files/benchmark/segmentation_benchmark/zero_shot_transfer.py CHANGED
@@ -81,6 +81,7 @@ def zero_shot_proposed(
81
  rho, _ = spearmanr(y, y_hat)
82
 
83
  print(f"Average Spearman correlation: {rho:.4f}")
 
84
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
85
  # END OF FILE #
86
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
 
81
  rho, _ = spearmanr(y, y_hat)
82
 
83
  print(f"Average Spearman correlation: {rho:.4f}")
84
+ return rho
85
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
86
  # END OF FILE #
87
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
research_files/zero_shot_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "Alverciito/wikipedia_segmentation": 0.13476829801490514,
3
+ "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2": 0.8007057781768085,
4
+ "hiiamsid/sentence_similarity_spanish_es": 0.8126300355781378,
5
+ "google-bert/bert-base-multilingual-cased": 0.5917908219072123,
6
+ "sentence-transformers/LaBSE": 0.7317496155094046,
7
+ "FacebookAI/xlm-roberta-base": 0.5289939928786738
8
+ }
research_files/zero_shot_tranfer_experiment.py CHANGED
@@ -5,17 +5,31 @@
5
  # #
6
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
7
  # Import statements:
8
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
9
- # START OF FILE #
10
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
11
  import os
 
12
  from benchmark.segmentation_benchmark.zero_shot_transfer import zero_shot_proposed
13
 
 
 
 
 
 
 
 
 
 
 
14
  __file_path__ = os.path.dirname(__file__)
15
 
16
  if __name__ == '__main__':
17
- # zero_shot_proposed("hiiamsid/sentence_similarity_spanish_es", "nflechas/semantic_sentence_similarity_ES")
18
- zero_shot_proposed("Alverciito/wikipedia_segmentation", "nflechas/semantic_sentence_similarity_ES")
 
 
 
 
 
 
19
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
20
  # END OF FILE #
21
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
 
5
  # #
6
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
7
  # Import statements:
 
 
 
8
  import os
9
+ import json
10
  from benchmark.segmentation_benchmark.zero_shot_transfer import zero_shot_proposed
11
 
12
+ MODELS = [
13
+ "Alverciito/wikipedia_segmentation",
14
+ "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2", # Baseline Multilingual - sBERT
15
+ 'hiiamsid/sentence_similarity_spanish_es', # Spanish similarity - sBERT
16
+ # "jaimevera1107/all-MiniLM-L6-v2-similarity-es", # Spanish similarity - sBERT
17
+ "google-bert/bert-base-multilingual-cased", # mBERT (google)
18
+ "sentence-transformers/LaBSE", # LaBSE (google)
19
+ "FacebookAI/xlm-roberta-base" # XLM-R (facebook)
20
+ ]
21
+
22
  __file_path__ = os.path.dirname(__file__)
23
 
24
  if __name__ == '__main__':
25
+ results = dict()
26
+ for model in MODELS:
27
+ rho = zero_shot_proposed(model, "nflechas/semantic_sentence_similarity_ES")
28
+ results[model] = rho
29
+
30
+ with open(os.path.join(__file_path__, 'zero_shot_results.json'), 'w', encoding='utf-8') as f:
31
+ json.dump(results, f, indent=4, ensure_ascii=False)
32
+
33
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #
34
  # END OF FILE #
35
  # - x - x - x - x - x - x - x - x - x - x - x - x - x - x - #