Skip to content

Intelligent classification system for internet entities (domains, companies, services) using rule-based labeling, machine learning and LLM verification

License

Notifications You must be signed in to change notification settings

zenithyangg/net-entity-classifier

Repository files navigation

互联网实体智能分类系统(net-entity-classifier)

项目简介

本项目(net-entity-classifier)实现了互联网实体(如域名、公司、服务、应用、类别)的自动识别与智能分类,结合规则标注、机器学习补充和大模型(LLM)复查,适用于大规模数据的高效、可扩展分类。

目录结构

.
├── data/                # 数据目录(仅保留示例数据)
│   └── example.csv      # 示例数据格式
├── labeling/            # 规则标注与特征工程
├── model/               # 机器学习训练脚本
├── pipeline/            # 数据处理与LLM复查脚本
├── deploy/              # 训练好的模型文件(建议不提交)
├── requirements.txt     # 依赖包列表
├── config.yaml          # 配置文件模板
├── README.md            # 项目说明(中文)
├── README_en.md         # Project documentation (English)
└── .gitignore           # Git忽略文件

环境准备

  • 推荐 Python 3.8 及以上
  • 安装依赖:
    pip install -r requirements.txt
  • (可选)建议使用虚拟环境:
    python -m venv net-entity-venv
    source net-entity-venv/bin/activate

数据准备

  • 请将原始数据按 data/example.csv 格式准备,字段包括:key, provider, service, app, category
  • 示例:
    key,provider,service,app
    akamaitechnologies.com,Akamai Technologies, Inc.,Akamai
    amazonaws.com,Amazon Technologies, Inc.,AmazonAWS
    ...
    

使用流程

  1. 数据清洗
    python pipeline/data_clean_and_rule_label.py
  2. 规则标注
    python labeling/auto_label.py
  3. 机器学习补充标注
    python pipeline/ml_fill_unlabeled.py
  4. LLM复查(可选,需API Key)
    • 配置API Key(如 DeepSeek):
      export DEEPSEEK_API_KEY=your-key
    • 运行:
      python pipeline/llm_check_label.py

常见问题

  • 数据文件找不到? 请确保在项目根目录下运行脚本,且数据文件路径正确。
  • 依赖安装失败? 检查Python版本,或尝试升级pip。
  • LLM检查API限流? 可调低并发线程数,或分批处理。

贡献指南

  • 欢迎提交PR、Issue,或补充规则字典、标注函数。
  • 建议先fork本项目,测试无误后再提交合并请求。

如有问题请在GitHub Issue区留言。

About

Intelligent classification system for internet entities (domains, companies, services) using rule-based labeling, machine learning and LLM verification

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages