代码之家  ›  专栏  ›  技术社区  ›  mr.bjerre

在spacy中的令牌级别具有变量上下文状态

  •  0
  • mr.bjerre  · 技术社区  · 6 年前

    使用 spaCy

    Now I am talking about cities and that is my current state. But now I talk about countries and then that is my state.
    

    为了代币 Now I am talking about 状态未知,而从 cities and that is my current state. But now I talk about 国家是 CITY 剩下的就是 COUNTRY . 别介意这个坏例子。

    Token.set_extension('state', default=None)
    

    然后更改 Doc cities countries ,但这会让事情慢下来,这是一个值得关注的问题。

    痉挛 有更聪明的方法来实现这种逻辑吗?

    0 回复  |  直到 6 年前