Skip to content

Commit

Permalink
增加词表文档
Browse files Browse the repository at this point in the history
  • Loading branch information
AlongWY committed Jul 5, 2023
1 parent da67549 commit 2aeeeec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ if torch.cuda.is_available():
# ltp.cuda()
ltp.to("cuda")

# 自定义词表
ltp.add_word("汤姆去", freq=2)
ltp.add_words(["外套", "外衣"], freq=2)

# 分词 cws、词性 pos、命名实体标注 ner、语义角色标注 srl、依存句法分析 dep、语义依存分析树 sdp、语义依存分析图 sdpg
output = ltp.pipeline(["他叫汤姆去拿外衣。"], tasks=["cws", "pos", "ner", "srl", "dep", "sdp", "sdpg"])
# 使用字典格式作为返回结果
Expand Down

0 comments on commit 2aeeeec

Please sign in to comment.