ner.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:productner 作者: etano 项目源码 文件源码
def get_labels(self, tag_sets):
        """Create labels from a list of tag_sets

        Args:
            tag_sets (list(list(str))): A list of word tag sets
        Returns:
            (list(list(int))): List of list of indices
        """
        labels = []
        print('Getting labels...')
        for tag_set in tag_sets:
            indexed_tags = self.index_tags(tag_set)
            labels.append(to_categorical(np.asarray(indexed_tags), num_classes=4))
        labels = pad_sequences(labels, maxlen=200)
        return labels
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号