INNER CODE UNIT · Python

relevant_rows

NorskRegnesentral/skweak · skweak/aggregation.py:128

        relevant_rows = (out_label_votes.sum(axis=1) > 0.0)
        
        return obs[relevant_rows] #type: ignore
        
        
    @abstractmethod
    def aggregate(self, obs: pandas.DataFrame) -> pandas.DataFrame:
        """Takes as input a 2D dataframe of shape (nb_entries, nb_sources) 
        associating each token/span to a set of observations from labelling 
        sources, and returns a 2D dataframe of shape (nb_entries, nb_labels)
        assocating each entry to the probability of each output label. 
        """

        raise NotImplementedError("must implement aggregate")        
    
    @abstractmethod
    def _get_spans(self, agg_df: pandas.DataFrame, threshold=0.5) \
        -> List[Tuple[int,int,str]]:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…