Skip to main content

To format verdict

Project description

判決書格式轉換

使用方法

安裝套件 pip install VerdictFormat

把正式格式轉成測試格式

from VerdictFormat import Formal_to_Test
Formal_to_Test(Formal_format_path,output_path)

把測試格式轉成正式格式

from VerdictFormat import Test_to_Formal
Test_to_Formal(Test_format_path,output_path)

把標記好的格式轉成測試格式

from VerdictFormat import Labeled_to_Test
Labeled_to_Test(Labeled_data)

正規化多個法條

from VerdictFormat import Multilaws_to_Normalize
Multilaws_to_Normalize(CJ_text,Match_laws_list,Multilaws_dict_list)
CJ_text : 判決書全文
Match_laws_list : 執掌法條清單
Multilaws_dict_list : 要正規化的法條

Formal Format

[
{
    "name": "姓名",
    "statuses": [
        {
          "status":"公務員", 
          "locations": 
          [
            {
              "field":"JFull",
              "start": 28, 
              "end":40
            }
          ]
        }
      ], 
    "positions": [
        {
          "work unit": "勞動部職業安全衛生署南部職業安全衛生中心",
          "title": "檢查員",
          "locations": 
          [
            {
              "field":"JFull",
              "start": 28, 
              "end":40
            }
          ]
        },
        {
          "work unit": "勞動部職業安全衛生署",
          "title": "職員",
          "locations": []
        }
      ],
    "laws": [
        {
          "act": "貪污治罪條例",
          "article": 4, 
          "paragraph":  1,
          "subparagraph": 2, 
          "locations": 
          [
            {
              "field":"JLaw",
              "start": 28, 
              "end":40
            }, 
            {
              "field":"JLaw",
              "start": 156, 
              "end":168
            }
          ]
        } 
      ]  
  }
]

Test Format

[
{
		"content_id" : "1" ,
		"name" : "柯森" ,
		"job_location" : [] ,
		"job_title" : [] ,
		"laws" : ["中華民國刑法第276條第1項","中華民國刑法第140條"]
    },{
		"content_id" : "2" ,
		"name" : "吳柯森" ,
		"job_location" : ["停車場"] ,
		"job_title" : ["管理員"] ,
		"laws" : ["中華民國刑法第276條第1項","中華民國刑法第140條"]
    }
]

Multilaws Normalize

Multilaws_dict_list=[
        {"start": 2933, "content": "毒品危害防制條例第11條"},
        {"start": 2946, "content": "第13條"},
        {"start": 2951, "content": "第15\r\n條"},
        {"start": 3315, "content": "貪污治罪條例第11條"},
        {"start": 3326, "content": "第133333條第8項\r\n第6款"},
    ]
Normalized_laws_list=['毒品危害防制條例第11條', '毒品危害防制條例第13條', '毒品危害防制條例第15條', '貪污治罪條例第11條', '貪污治罪條例第133333條第8項第6款']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

VerdictFormat-1.6.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

VerdictFormat-1.6-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file VerdictFormat-1.6.tar.gz.

File metadata

  • Download URL: VerdictFormat-1.6.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.4

File hashes

Hashes for VerdictFormat-1.6.tar.gz
Algorithm Hash digest
SHA256 5f11b500952be0f539d873d48ccb6d14e8b3321d456c5b697dd68e30e0e61196
MD5 d7a0d9c15f4a7c7b1f17846523ae97cd
BLAKE2b-256 2fe2fd0f8c2d670b52b0767a7677ee2bc465e47c157275dd976d93f09f8d7cc3

See more details on using hashes here.

File details

Details for the file VerdictFormat-1.6-py3-none-any.whl.

File metadata

  • Download URL: VerdictFormat-1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.4

File hashes

Hashes for VerdictFormat-1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6424810b41e61fa668ea66213bf96fd3e6a1310257eaef592620d34a6468d575
MD5 d0b8135002b5706f903428b64d86d350
BLAKE2b-256 09b9ed84abc2ebf3079f750586999e176b6e2e3a3511e719a544ed2a9d06b743

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page