🚀 GLiNER PII模型卡
GLiNER是一個命名實體識別(NER)模型,它藉助雙向變壓器編碼器(類似BERT),能夠識別任何類型的實體。相較於傳統的NER模型(侷限於預定義實體)和大型語言模型(LLMs,雖靈活但在資源受限場景下成本高、規模大),它提供了一個實用的替代方案。
該模型是通過在urchade/synthetic-pii-ner-mistral-v1
數據集上微調urchade/gliner_multi-v2.1
而訓練得到的。此模型能夠識別各種類型的個人身份信息(PII),包括但不限於以下實體類型:person
(個人)、organization
(組織)、phone number
(電話號碼)、address
(地址)、passport number
(護照號碼)、email
(電子郵件)、credit card number
(信用卡號碼)、social security number
(社會安全號碼)、health insurance id number
(健康保險ID號碼)、date of birth
(出生日期)、mobile phone number
(手機號碼)、bank account number
(銀行賬號)、medication
(藥物)、cpf
(巴西個人稅號)、driver's license number
(駕照號碼)、tax identification number
(稅務識別號碼)、medical condition
(醫療狀況)、identity card number
(身份證號碼)、national id number
(國家身份證號碼)、ip address
(IP地址)、email address
(電子郵件地址)、iban
(國際銀行賬號)、credit card expiration date
(信用卡到期日期)、username
(用戶名)、health insurance number
(健康保險號碼)、registration number
(註冊號碼)、student id number
(學生ID號碼)、insurance number
(保險號碼)、flight number
(航班號碼)、landline phone number
(固定電話號碼)、blood type
(血型)、cvv
(信用卡驗證碼)、reservation number
(預訂號碼)、digital signature
(數字簽名)、social media handle
(社交媒體賬號)、license plate number
(車牌號碼)、cnpj
(巴西公司稅號)、postal code
(郵政編碼)、passport_number
(護照號碼)、serial number
(序列號)、vehicle registration number
(車輛註冊號碼)、credit card brand
(信用卡品牌)、fax number
(傳真號碼)、visa number
(簽證號碼)、insurance company
(保險公司)、identity document number
(身份文件號碼)、transaction number
(交易號碼)、national health insurance number
(國家健康保險號碼)、cvc
(信用卡驗證碼)、birth certificate number
(出生證明號碼)、train ticket number
(火車票號碼)、passport expiration date
(護照到期日期)和social_security_number
(社會安全號碼)。
🚀 快速開始
模型調用示例
from gliner import GLiNER
model = GLiNER.from_pretrained("urchade/gliner_multi_pii-v1")
text = """
Harilala Rasoanaivo, un homme d'affaires local d'Antananarivo, a enregistré une nouvelle société nommée "Rasoanaivo Enterprises" au Lot II M 92 Antohomadinika. Son numéro est le +261 32 22 345 67, et son adresse électronique est harilala.rasoanaivo@telma.mg. Il a fourni son numéro de sécu 501-02-1234 pour l'enregistrement.
"""
labels = ["work", "booking number", "personally identifiable information", "driver licence", "person", "book", "full address", "company", "actor", "character", "email", "passport number", "Social Security Number", "phone number"]
entities = model.predict_entities(text, labels)
for entity in entities:
print(entity["text"], "=>", entity["label"])
運行結果
Harilala Rasoanaivo => person
Rasoanaivo Enterprises => company
Lot II M 92 Antohomadinika => full address
+261 32 22 345 67 => phone number
harilala.rasoanaivo@telma.mg => email
501-02-1234 => Social Security Number
📚 詳細文檔
相關鏈接
📄 許可證
本項目採用Apache-2.0許可證。
🔍 信息表格
屬性 |
詳情 |
模型類型 |
命名實體識別(NER)模型 |
訓練數據 |
urchade/synthetic-pii-ner-mistral-v1 |
支持語言 |
英語、法語、德語、西班牙語、葡萄牙語、意大利語 |
庫名稱 |
gliner |
任務類型 |
標記分類 |