-
Notifications
You must be signed in to change notification settings - Fork 38
02.2 工具包:LawToolkit 法條文字檢索
Droidtown Linguistic. Tech. Co., Ltd edited this page May 30, 2021
·
1 revision
此頁說明 LawToolkit 法條文字檢索工具操作方式:
- 首先利用取得 Articut 處理文本,取得 resultDICT:
from ArticutAPI import Articut
from pprint import pprint
username = "" #這裡填入您在 https://api.droidtown.co 使用的帳號 email。若使用空字串,則預設使用每小時 2000 字的公用額度。
apikey = "" #這裡填入您在 https://api.droidtown.co 登入後取得的 api Key。若使用空字串,則預設使用每小時 2000 字的公用額度。
articut = Articut(username, apikey)
inputSTR = """楊進勝犯血液中酒精濃度達百分之零點零五以上而駕駛動力交通工具罪,
處有期徒刑參月,如易科罰金,以新臺幣壹仟元折算壹日。被告楊進勝所
為,係犯刑法第185 條之3 第1項第1 款之血液中酒精濃度達百分之0.05
以上而駕駛動力交通工具罪。""".replace("\n", "").replace(" ", "")
resultDICT = articut.parse(inputSTR)- 接著,將 resultDICT 傳給 LawsToolkit 工具:
# getCrime() 取出「法律」名稱 (e.g., 民法、刑法) 以及罪名。
crimeLIST = articut.LawsToolkit.getCrime(resultDICT)
pprint(crimeLIST)
# ['刑法', '血液中酒精濃度達百分之零點零五以上而駕駛動力交通工具罪']
# getPenalty() 取出判決文中的刑責
penaltyLIST = articut.LawsToolkit.getPenalty(resultDICT)
pprint(penaltyLIST)
# ['有期徒刑參月']
# getLawArticle() 取得法條編號
lawIndexLIST = articut.LawsToolkit.getLawArticle(resultDICT)
pprint(lawIndexLIST)
# ['第185 條之3 第1 項第1 款']透過這法條文字檢索工具的處理,就能更快地整理出相關/相同刑責的判決、法條編號或是最常被用於提告或起訴的罪名囉。
Droidtown Linguistic Tech.
Document | Blog | Twitter @DroidtownLing | Facebook @Articut | Website