es: Elasticsearch The Elasticsearch client """ # Convert the new_predictions DataFrame to a list of dictionaries # The columns of the new_predicitons DataFrame are 'PMID', 'date', 'date_completed', 'label', 'text' # Only the 'PMID', 'date', 'date_completed', and 'label' columns are needed new_predictions = new_predictions[['PMID', 'date', 'date_completed', 'label']].to_dict(orient='records') logger.debug(f'Adding {len(new_predictions)} new predictions to the predictions index {index}: First 5: {new_predictions[:5]}') # Add the new predictions to the predictions index helpers.bulk(es, [{'_index': index, '_id': int(doc['PMID']), '_source': doc} for doc in new_predictions]) def _compute_cluster_names(self, X: Union[List[str], pd.Series]) -> None: """ Compute the cluster names Parameters ---------- X : Union[List[str], Series] The documents y : np.ndarray The labels Returns ------- Dict[int, str] The cluster names """ raise NotImplementedError @abstractmethod def _preprocess(self, X: Union[List[str], pd.Series]) -> Union[List[str], pd.Series]: """ Preprocess a batch of documents Parameters ---------- X : Union[List[str], Series] The documents Returns ------- Union[List[str], Series] The preprocessed documents """ raise NotImplementedError @abstractmethod def _preprocess_single(self, x: str) -> str: """ Preprocess a single document Parameters ---------- x : str The document Returns ------- st