Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
liu946 committed Dec 24, 2017
1 parent 31ca417 commit 8dd4efe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ltp4j<sup>beta</sup>: Language Technology Platform For Java
[![Build Status](https://travis-ci.org/HIT-SCIR/ltp4j.svg?branch=integrate-test)](https://travis-ci.org/HIT-SCIR/ltp4j)
[![Documentation Status](https://readthedocs.org/projects/ltp/badge/?version=latest)](http://ltp4j.readthedocs.org/en/neoltp4j/?badge=neoltp4j)

# 更新

1. ltp4j 现已经更新对 LTP 3.4.0的支持。
2. 项目改用 maven 构建、编译。具体使用方法参见文档。

# 简介

ltp4j是语言技术平台[(Language Technology Platform, LTP)](https://github.com/HIT-SCIR/ltp)接口的一个Java封装。
Expand Down
6 changes: 2 additions & 4 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
+----------------------------+--------------------------------------------------------------------+
| 参数名 | 参数描述 |
+============================+====================================================================+
| String modelPath | 语义角色标注模型文件夹所在路径 |
| String modelPath | 语义角色标注模型文件所在路径 |
+----------------------------+--------------------------------------------------------------------+

.. java:method:: public final native void release()
Expand All @@ -383,7 +383,7 @@
释放模型文件,销毁命名实体识别器。


.. java:method:: public final native int srl(List<String> words, List<String> tags, List<String> ners, List<Integer> heads, List<String> deprels, List<Pair<Integer, List<Pair<String, Pair<Integer, Integer>>>>> srls)
.. java:method:: public final native int srl(List<String> words, List<String> tags, List<Integer> heads, List<String> deprels, List<Pair<Integer, List<Pair<String, Pair<Integer, Integer>>>>> srls)
功能:

Expand All @@ -398,8 +398,6 @@
+---------------------------------------------------+-----------------------------------------------------------+
| List<String> tags | 输入的词性序列 |
+---------------------------------------------------+-----------------------------------------------------------+
| List<String> ners | 输入的命名实体序列 |
+---------------------------------------------------+-----------------------------------------------------------+
| List<Integer> heads | 这个词的父节点的编号 [#f1]_ |
+---------------------------------------------------+-----------------------------------------------------------+
| List<String> deprels | 这个词的父节点的依存关系类型 |
Expand Down
9 changes: 2 additions & 7 deletions doc/ltp4j-document-1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ edu.ir.hit.ltp4j.SRL
public class TestSrl {

public static void main(String[] args) {
SRL.create("../../../ltp_data/srl");
SRL.create("../../../ltp_data/pisrl.model");
ArrayList<String> words = new ArrayList<String>();
words.add("一把手");
words.add("亲自");
Expand All @@ -566,11 +566,6 @@ edu.ir.hit.ltp4j.SRL
tags.add("d");
tags.add("v");
tags.add("wp");
ArrayList<String> ners = new ArrayList<String>();
ners.add("O");
ners.add("O");
ners.add("O");
ners.add("O");
ArrayList<Integer> heads = new ArrayList<Integer>();
heads.add(2);
heads.add(2);
Expand All @@ -582,7 +577,7 @@ edu.ir.hit.ltp4j.SRL
deprels.add("HED");
deprels.add("WP");
List<Pair<Integer, List<Pair<String, Pair<Integer, Integer>>>>> srls = new ArrayList<Pair<Integer, List<Pair<String, Pair<Integer, Integer>>>>>();
SRL.srl(words, tags, ners, heads, deprels, srls);
SRL.srl(words, tags, heads, deprels, srls);
for (int i = 0; i < srls.size(); ++i) {
System.out.println(srls.get(i).first + ":");
for (int j = 0; j < srls.get(i).second.size(); ++j) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/edu/hit/ir/ltp4j/test/SRLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public class SRLTest {
throws Exception
{
SRL app = new SRL();
Assert.assertEquals( 1, app.create("ltp_data/srl/") );
Assert.assertEquals( 1, app.create("ltp_data/pisrl.model") );
}
}

0 comments on commit 8dd4efe

Please sign in to comment.