代码之家  ›  专栏  ›  技术社区  ›  vinita

基于数据库中的值作为训练集从电子邮件中提取字段

  •  1
  • vinita  · 技术社区  · 8 年前

    [个人、学位、工作/不工作、角色]

    例如,其中一封电子邮件如下所示:-

        Hi Amy,
    
        I wanted to discuss about Bob. I can see that he has a degree in 
        Computer Science which he got three years ago but hes still unemployed. 
        I dont know whetehr he'll be fit for the role of junior programmer at 
        our institute.
        Will get back to you on this.
    
        Thanks
    

    此电子邮件的相应数据库条目如下所示

    Email_123 | Bob | Computer Science | Unemployed | Junior Programmer
    

    现在,即使数据没有被标记,但我们仍然有一个数据库来查找从每个电子邮件的4个字段中提取了哪些值。 我需要手动标记这480封电子邮件吗。。

    I wanted to discuss about <person>Bob</person>. I can see that he has a degree in 
        <degree>Computer Science</degree> which he got....
    

    还是有更好的方法。类似这样的东西(MarI/O-视频游戏的机器学习) https://www.youtube.com/watch?v=qv6UVOQ0F44&t=149s

    1 回复  |  直到 8 年前
        1
  •  1
  •   polm23    8 年前

    WikiReading .

    WikiReading Extraction Example

    一百万 例如,如果你只有480个,这远远不够训练一个好的模型。

    我建议您对数据集进行预处理,以自动添加标记,如示例中所示。在伪python中是这样的:

    entity = "Junior Programmer"
    entity_type = "role"
    mail = "...[text of email]..."
    
    ind = mail.index(entity)
    tagged = "{front}<{tag}>{ent}</{tag}>{back}".format(
      front=mail[0:ind],
      back=mail[ind+len(entity):],
      tag=entity_type,
      ent=entity)
    

    对于标记数据,您可以使用传统的NER系统,如CRF。 Here 这是一个在Python中使用spaCy的教程。

    推荐文章