feature_construction.py 文件源码

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

项目:Automatic-Question-Generation 作者: bwanglzu 项目源码 文件源码
def _first_tagger_after_answer_span(self, question):
        """Get the first tagger after answer span
        - Args:
            question(string): string of current question 
        - Returns:
            tagger(string): tagger of first term after span
        """
        index = 0
        text = nltk.word_tokenize(question)
        post = nltk.pos_tag(text)
        for idx, t in enumerate(post):
            if t[0] == '_____':
                index = idx + 1
                break
        try:
            return post[index][1]
        except IndexError:
            return 'dummy'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号