File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
examples/text-classification/fasttext Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 625625 " \n " ,
626626 " import fasttext\n " ,
627627 " import pickle\n " ,
628- " \n " ,
628+ " import numpy as np \n " ,
629629 " \n " ,
630630 " from pathlib import Path\n " ,
631631 " from typing import List\n " ,
646646 " def predict_proba(self, input_data_df: pd.DataFrame):\n " ,
647647 " \"\"\" Makes predictions with the model. Returns the class probabilities.\"\"\"\n " ,
648648 " text_column = input_data_df.columns[0]\n " ,
649- " return input_data_df[text_column].apply(self._predict_row)\n " ,
649+ " \n " ,
650+ " preds = input_data_df[text_column].apply(self._predict_row)\n " ,
651+ " \n " ,
652+ " return np.stack(preds.values)\n " ,
650653 " \n " ,
651654 " def _predict_row(self, text: str) -> List[float]:\n " ,
652655 " text = text.replace(\"\\ n\" ,\" \" )\n " ,
You can’t perform that action at this time.
0 commit comments