Giter Site home page Giter Site logo

event_triple_extraction's Introduction

Event_Triple_Extraction

采用LTP抽取事件三元组

安装包

  • pip install plt

使用

from triple_extraction_ltp import TripleExtraction

content1 = '李克强总理今天来我家了,我感到非常荣幸'
content2 = ''' 以色列国防军20日对加沙地带实施轰炸,造成3名巴勒斯坦武装人员死亡。此外,巴勒斯坦人与以色列士兵当天在加沙地带与以交界地区发生冲突,一名巴勒斯坦人被打死。当天的冲突还造成210名巴勒斯坦人受伤。当天,数千名巴勒斯坦人在加沙地带边境地区继续“回归大游行”抗议活动。部分示威者燃烧轮胎,并向以军投掷石块、燃烧瓶等,驻守边境的以军士兵向示威人群发射催泪瓦斯并开枪射击。'''

extractor = TripleExtraction()
for text in [content1, content2]:
    print(text)
    res = extractor.triples_main(text)
    print(res)
    
# [['李克强总理', '来', '我家'], ['我', '感到', '非常荣幸']]
# [['以色列国防军', '实施', '轰炸'], ['冲突', '发生', '巴勒斯坦人与以色列士兵'], ['当天冲突', '造成', '210名巴勒斯坦人受伤'], ['数千名巴勒斯坦人', '继续', '回归大游行抗议活动'], ['部分示威者', '燃烧', '轮胎'], ['部分示威者', '投掷', '石块燃烧瓶'], [',', '驻守', '边境'], ['驻守边境以军士兵', '发射', '催泪瓦斯']]

项目来源

event_triple_extraction's People

Contributors

murray-z avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.