def tag ( self , nerdoc ) : labels = [ ] for snt in nerdoc . sentences : xseq = [ t . feature_list ( ) for t in snt ] yseq = self . tagger . tag ( xseq ) labels . append ( yseq ) return labels
how to label each sentence in a documentin python
Tag the given document . Parameters ---------- nerdoc : estnltk . estner . Document The document to be tagged .
def tag(self, nerdoc):
        """Tag the given document.
        Parameters
        ----------
        nerdoc: estnltk.estner.Document
            The document to be tagged.

        Returns
        -------
        labels: list of lists of str
            Predicted token Labels for each sentence in the document
        """

        labels = []
        for snt in nerdoc.sentences:
            xseq = [t.feature_list() for t in snt]
            yseq = self.tagger.tag(xseq)
            labels.append(yseq)
        return labels