No project description provided
Project description
Introduction
This package helps you add punctuation and named entity recognition(ner) to Ming-Shilu, it also shows the position where ner or punctuation is used.
Installation
pip install IISRapi
Usage
Import:
from IISRapi.model import ner, pun, data
To use GPU:
You can check the No. of the GPU you want to use by going to task manager
ner_res=ner.IISRner(dev=your_GPU_num)
pun_res=pun.IISRpunctuation(dev=your_GPU_num)
To use CPU:
Change your_GPU_num to -1
Getting result:
method 1:
print(ner_res(your_str))
print(pun_res(your_str))
method 2:
a=data.Data(your_str)
print(ner_res(a))
print(pun_res(a))
Both will print out result in the format Data(Input_string, Result_string, Ner_position, Punctuation_position)
example
# -*- coding: utf-8 -*-
from IISRapi import tool,data
result=tool.IISRpunctuation(dev=1)
test_str=data.struct(ori_txt="給宣府等處屯牛時調操軍二千八百人於宣府赤城雲州雕鶚屯田俱言無牛耕種乃以河間保定諸府衛官牛五千餘只給之")
for k in result(test_str):
print(k)
print('\n')
Notice
- If you want to use GPU to run modules, uninstall torch and visit https://pytorch.org/get-started/locally/
- If you use both functions at the same time, either ner_res(pun_res(your_str)) or pun_res(ner_res(your_str)), the result will only show the result of the function which is done later.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file IISRapi-1.3.tar.gz.
File metadata
- Download URL: IISRapi-1.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a775ed1a47b2c51627fee8ac8c4f6aecec0883147f2d73a736638781db40aebd
|
|
| MD5 |
dd961ce7c2024158e11ddd91208433e6
|
|
| BLAKE2b-256 |
13feeda28e8368a19d0c2b7889165b6b93cc7649dac6c29819d1561d1c026097
|
File details
Details for the file IISRapi-1.3-py3-none-any.whl.
File metadata
- Download URL: IISRapi-1.3-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32a0639c7c5dbd3ec2bc9fae9faa607031cb92103ce0f43b9bc03af115725d75
|
|
| MD5 |
d236829369b734fd7e7bbdcbddc12cd7
|
|
| BLAKE2b-256 |
8a16bd7855ab10fe0b21708a6510286a61a5d12523382c52631ae400e7fa0b43
|