复数事象抽出、依存文法三元组抽出

警情抽出 & 三角形抽出

プロジェクトリポジトリ:https://github.com/jiangnanboy/triple_event_extract

  1. 中文复数事象抽出
  • 必要事象抽出(必要条件抽出)
  • 原因事象抽出
  • 接承事象抽出
  • 反转事象抽出等事象抽出
 String butPath = PropertyLoader.load(
     new String[] {ResourceAsStream.getResourceAsStream("but")},
     new String[] {PropertyLoader.class}
 ).getAbsolutePath().replaceFirst("/", "");
 String seqPath = PropertyLoader.load(
     new String[] {ResourceAsStream.getResourceAsStream("seq")},
     new String[] {PropertyLoader.class}
 ).getAbsolutePath().replaceFirst("/", "");
 String morePath = PropertyLoader.load(
     new String[] {ResourceAsStream.getResourceAsStream("more")},
     new String[] {PropertyLoader.class}
 ).getAbsolutePath().replaceFirst("/", "");
 String conditionPath = PropertyLoader.load(
     new String[] {ResourceAsStream.getResourceAsStream("condition")},
     new String[] {PropertyLoader.class}
 ).getAbsolutePath().replaceFirst("/", "");
 List<String> pathList = Arrays.asList(new String[]{butPath, seqPath, morePath, conditionPath});
 EventExtraction eventsExtraction = new EventExtraction(pathList);
 List<Map<String, String>> dataList = eventsExtraction.extractMain(" spite of the fact that this matter is difficult, we can completely overcome it. If this matter is not difficult, we do not need to process it at all.");
 System.out.println(dataList);

 // 結果
 [{type=but, tuples={"preWd":" spite of the fact that", "prePart":"this matter is difficult,","postWd":"but","postPart":"we can completely overcome it"}, sent=" spite of the fact that this matter is difficult, we can completely overcome it。"}, {type=condition, tuples={"preWd":"if","prePart":"this matter is not difficult, we","postWd":"just","postPart":"do not need to process it at all"}, sent="if this matter is not difficult, we do not need to process it at all。"}]

  1. 依存文法の三角形抽出
 String content = "新报 hookup from 广州警方获悉,2002年1月7日,广州番禺警方接到群众报警,称其朋友卢某(男)于1月6日凌晨失踪。警方随后在番禺区市桥街一出租屋内找到卢某,当时卢某已经死亡,身上财物丢失。案发后没多久,番禺警方就将涉嫌参与抢劫杀害卢某的其中三名嫌疑人耿某、胡某以及翁某(女)抓获归案,另有一名嫌疑人力天佑负案在逃。\n" +
                                   "据嫌疑人交代,2002年元旦过后,力天佑找到耿某和胡某,告知两人有一个"发财"的机会:力天佑发现卢某很有钱,密谋由翁某将卢某带回翁某租住的出租屋,力天佑等三人伺机进入出租屋抢劫。\n" +
                                   "案发当天,力天佑带着耿某和胡某先行进入翁某租住的出租屋内等待。晚上22时许,翁某带着卢某回到出租屋,一进入屋内,力天佑等三人合力将卢某推倒在床上,用手捂住卢某嘴巴,用绳索绑住卢某手脚。一番拳打脚踢之后,力天佑从卢某身上搜出两台手机和一个钱包,将其中一台手机给了耿某,又给了胡某一千元钱。眼见卢某因窒息而死,四人逃离了出租屋。\n" +
                                   "卢某的家人和朋友因为一直无法联系上卢某,多方找寻未果,向番禺警方报警。警方很快将翁某、耿某和胡某三人抓获,但狡猾的力天佑一直潜逃在外。";
 TriplesMine triplesMine = new TriplesMine();
 List<List<String>> triplesList = triplesMine.extractSpo(content);
 System.out.println(triplesList);

 // 結果
[[記者, 获悉, 接到], [警方, 接到, 报警], [民警, 找到, 卢某], [力天佑, 找到, 耿某], [二人, 有, 机会], [力天佑, 发现, 有钱], [人, 进入, 出租屋], [卢某, 回到, 出租屋], [一, 进入, 屋内], [人, 推倒, 床上], [力天佑, 搜出, 手机], [手机, 要給, 耿某], [卢某, 逃離, 出租屋], [人, 逃離, 出租屋], [家屬, 聯絡, 卢某]]<br></br><br></br><br></br>

contact

問い合わせ

タグ: EventExtraction TripleExtraction DependencyTriplesExtracting

6月25日 17:14 投稿