9b2f98b435d6b21a0f5d49c1a5a23c97e7357d6f,finetune/target_models/ordinal_regressor.py,OrdinalRegressor,predict,#OrdinalRegressor#Any#,46
Before Change
:param X: list or array of text to embed.
:returns: list of class labels.
return super().predict(X).tolist()
def predict_proba(self, X):
Produces a probability distribution over classes for each example in X.
After Change
:returns: list of class labels.
all_labels=[]
for _, start_of_doc, end_of_doc, label, _ in self.process_long_sequence(X):
if start_of_doc:
// if this is the first chunk in a document, start accumulating from scratch
doc_labels = []
doc_labels.append(label)
if end_of_doc:
// last chunk in a document
means = np.mean(doc_labels, axis=0)
label = self.input_pipeline.label_encoder.inverse_transform([means])
all_labels.append(list(label))
return all_labels
def predict_proba(self, X):
Produces a probability distribution over classes for each example in X.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: IndicoDataSolutions/finetune
Commit Name: 9b2f98b435d6b21a0f5d49c1a5a23c97e7357d6f
Time: 2019-07-17
Author: matthew.bayer@indico.io
File Name: finetune/target_models/ordinal_regressor.py
Class Name: OrdinalRegressor
Method Name: predict
Project Name: kwgoodman/numerox
Commit Name: 841ea44e30577258ddae735701ef45055abdc3f8
Time: 2018-08-30
Author: kwgoodman@gmail.com
File Name: numerox/prediction.py
Class Name: Prediction
Method Name: names
Project Name: IndicoDataSolutions/finetune
Commit Name: e9eb9d3cdef98f21f754b577b88dc259a9914ede
Time: 2019-07-17
Author: matthew.bayer@indico.io
File Name: finetune/target_models/regressor.py
Class Name: Regressor
Method Name: predict
Project Name: IndicoDataSolutions/finetune
Commit Name: 9b2f98b435d6b21a0f5d49c1a5a23c97e7357d6f
Time: 2019-07-17
Author: matthew.bayer@indico.io
File Name: finetune/target_models/ordinal_regressor.py
Class Name: OrdinalRegressor
Method Name: predict