fixed transform_mean() when dealing with only one VG;

modified default settings (new default: aggregation: mean, all_prob:True)
This commit is contained in:
andrea 2020-10-29 12:55:07 +01:00
parent 20dca61e22
commit 8af763b130
2 changed files with 4 additions and 2 deletions

View File

@ -490,6 +490,8 @@ class DocEmbedderList:
def transform_mean(self, lX, tfidf): def transform_mean(self, lX, tfidf):
if len(self.embedders) == 1: if len(self.embedders) == 1:
if self.embedders[0].requires_tfidf:
lX = tfidf
return self.embedders[0].transform(lX) return self.embedders[0].transform(lX)
langs = sorted(lX.keys()) langs = sorted(lX.keys())

View File

@ -29,7 +29,7 @@ parser.add_option("--l2", dest="l2", action='store_true',
parser.add_option("--allprob", dest="allprob", action='store_true', parser.add_option("--allprob", dest="allprob", action='store_true',
help="All views are generated as posterior probabilities. This affects the supervised and pretrained" help="All views are generated as posterior probabilities. This affects the supervised and pretrained"
"embeddings, for which a calibrated classifier is generated, which generates the posteriors", "embeddings, for which a calibrated classifier is generated, which generates the posteriors",
default=False) default=True)
parser.add_option("--feat-weight", dest="feat_weight", parser.add_option("--feat-weight", dest="feat_weight",
help="Term weighting function to weight the averaged embeddings", type=str, default='tfidf') help="Term weighting function to weight the averaged embeddings", type=str, default='tfidf')
@ -58,7 +58,7 @@ parser.add_option("-z", "--zscore", dest="zscore", action='store_true',
parser.add_option("-a", "--agg", dest="agg", action='store_true', parser.add_option("-a", "--agg", dest="agg", action='store_true',
help="Set aggregation function of the common Z-space to average (Default: concatenation)", help="Set aggregation function of the common Z-space to average (Default: concatenation)",
default=False) default=True)
# ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------