├── 方案分享 ├── 飞飞公主组 │ ├── data │ │ ├── content │ │ ├── dataset_info.json │ │ ├── training_loss.png │ │ ├── merge_finance_maodun.yaml │ │ ├── train_qwen2_7b_finance_maodun.yaml │ │ └── result.json │ ├── content │ ├── roundb │ │ ├── content │ │ ├── 银行理财产品周报.docx │ │ ├── 中华人民共和国审计法.docx │ │ ├── 中华人民共和国预算法.docx │ │ ├── 中华人民共和国招标投标法.docx │ │ ├── 中华人民共和国社会保险法.docx │ │ ├── 中华人民共和国预算法实施条例.docx │ │ ├── 长城钻探昆山公司2024年度国际货代.docx │ │ ├── 平安产险学生意外伤害保险(互联网版)条款.docx │ │ ├── 平安产险老年人医疗费用保险(互联网版)条款.docx │ │ ├── 西南管道公司2024年B型套筒物资采购项目.docx │ │ ├── 部分长丝装置停车改造化工品价差继续扩大.docx │ │ ├── 中油测井激发极化仪器数据处理方法研究及正反演软.docx │ │ ├── 平安产险女性安康特定疾病保险(互联网版)条款.docx │ │ ├── 中国医学科学院北区物业综合管理服务采购项目招标公告.docx │ │ ├── 中国医学科学院阜外医院风机盘管维保采购项目招标公告.docx │ │ ├── 化工行业周报:细分板块关注度提升,产品价格延续涨势.docx │ │ ├── 商用车:4月重卡销量略超预期,出口+天然气持续高增.docx │ │ ├── 四川大学华西医院PACS计算存储采购项目招标公告.docx │ │ ├── 塔里木二期项目裂解气清焦阀和传输阀(变更)(变更).docx │ │ ├── 常州市消防救援支队本级指挥中心改造采购项目招标公告.docx │ │ ├── 影视行业行业动态:后续电影档期展望,复苏已变新成长.docx │ │ ├── 新能源事业部2024-2025年度项目管理咨询服务.docx │ │ ├── 消费行业五一消费观察:常态化复苏,结构性特征延续.docx │ │ ├── 西安市消防救援支队培训楼会议视频系统采购项目招标公告.docx │ │ ├── 银行行业:金融支持住房租赁发展,有望成为新业务增长点.docx │ │ ├── 中国医学科学院北京协和医院小型机服务器采购项目招标公告.docx │ │ ├── 中国医学科学院阜外医院西山园区保安服务采购项目招标公告.docx │ │ ├── 中国地震台网中心预警项目改扩建基础设施采购项目招标公告.docx │ │ ├── 化工行业周报:海外天然气价格上涨,纯碱、草甘膦价格上涨.docx │ │ ├── 北京市消防救援总队应急能力建设车辆装备购置项目五标段招标公告.docx │ │ ├── 咸阳宝石钢管钢绳有限公司2024-2025年度镀铬泵筒采购.docx │ │ ├── 玉门油田2024-2025炼化总厂易腐蚀管道脉冲涡流扫查服务.docx │ │ ├── 电子行业:2024Q1 PCB需求回暖,AI仍是主要驱动力.docx │ │ ├── 西南油气田分公司勘探事业部2024年度溢流监测预警系统技术服务.docx │ │ ├── 中国人民大学附属中学2024-2027年度保安服务采购项目招标公告.docx │ │ ├── 中油测井井下仪器在多温度、压力场中机械结构及性能仿真技术(二次).docx │ │ ├── 北京市消防救援总队应急能力建设车辆装备购置项目一标段二次招标公告.docx │ │ ├── 中国石油独山子石化公司聚烯烃二部四台往复式压缩机组采购项目公开招标二次.docx │ │ ├── 中国社会科学院大学良乡校区2024-2027年保安服务采购项目招标公告.docx │ │ ├── 社会服务:五一黄金周点评-国内出行韧性凸显,多重利好推动出境游增长靓丽.docx │ │ ├── 电力行业3月月报:中电联预计上半年用电量增速有望超8%,现货电价环比逐步企稳.docx │ │ ├── 西部钻探2024年井下作业公司前置蓄能压裂注气服务(X09-023)定商项目.docx │ │ ├── 中国人民银行山东省分行ACS内容缓存平台和安全云平台相关硬件设备采购项目招标公告.docx │ │ ├── 国家药品监督管理局医疗器械技术审评中心新址网络及多媒体融合集成采购项目招标公告.docx │ │ ├── 塔里木油田库尔勒上库高新区低碳转型130万千瓦光伏项目光伏区1标段EPC总承包.docx │ │ ├── 天津市地震局天津市巨灾防范工程-数据平台建设(省级中心信息化建设)采购项目招标公告.docx │ │ ├── 电力设备及新能源行业点评:Solaredge一季度续亏,欧美户用逆变器市场较弱.docx │ │ ├── 中国石油运输有限公司甘肃化工分公司固体化工产品(庆阳石化橡塑产品补充运力)运输服务项目.docx │ │ ├── 传媒互联网周报:OpenAI、小冰等国多模态AI应用落地,“数据要素X”三年行动计划正式印发.docx │ │ └── 汽车板块2023年年报&2024年一季报总结:2023年汽车各子板块业绩均改善,2024年Q1客车业绩超预期.docx │ ├── finance_maodun │ │ ├── content │ │ ├── __pycache__ │ │ │ ├── content │ │ │ ├── llm.cpython-310.pyc │ │ │ ├── llm.cpython-312.pyc │ │ │ ├── template.cpython-310.pyc │ │ │ └── template.cpython-312.pyc │ │ ├── requirements.txt │ │ ├── template.py │ │ ├── llm.py │ │ └── main.py │ ├── run.sh │ └── readme.md ├── 柠檬天然酸组 │ └── content └── financial_agent组 │ ├── content │ └── biaodi_post_handle.py └── README.md /方案分享/飞飞公主组/data/content: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /方案分享/柠檬天然酸组/content: -------------------------------------------------------------------------------- 1 | 测试文件夹.txt 2 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/content: -------------------------------------------------------------------------------- 1 | 测试文件夹.txt 2 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/content: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/content: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /方案分享/financial_agent组/content: -------------------------------------------------------------------------------- 1 | 测试文件夹.txt 2 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/__pycache__/content: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/data/dataset_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "finance_maodun": { 3 | "file_name": "finance_maodun.json" 4 | } 5 | } -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/requirements.txt: -------------------------------------------------------------------------------- 1 | docx==0.2.4 2 | torch==2.4.0 3 | tqdm==4.65.0 4 | transformers==4.43.3 5 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/银行理财产品周报.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/银行理财产品周报.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/data/training_loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/data/training_loss.png -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中华人民共和国审计法.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中华人民共和国审计法.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中华人民共和国预算法.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中华人民共和国预算法.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中华人民共和国招标投标法.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中华人民共和国招标投标法.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中华人民共和国社会保险法.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中华人民共和国社会保险法.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中华人民共和国预算法实施条例.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中华人民共和国预算法实施条例.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/长城钻探昆山公司2024年度国际货代.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/长城钻探昆山公司2024年度国际货代.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/平安产险学生意外伤害保险(互联网版)条款.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/平安产险学生意外伤害保险(互联网版)条款.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/平安产险老年人医疗费用保险(互联网版)条款.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/平安产险老年人医疗费用保险(互联网版)条款.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/西南管道公司2024年B型套筒物资采购项目.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/西南管道公司2024年B型套筒物资采购项目.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/部分长丝装置停车改造化工品价差继续扩大.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/部分长丝装置停车改造化工品价差继续扩大.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中油测井激发极化仪器数据处理方法研究及正反演软.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中油测井激发极化仪器数据处理方法研究及正反演软.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/平安产险女性安康特定疾病保险(互联网版)条款.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/平安产险女性安康特定疾病保险(互联网版)条款.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国医学科学院北区物业综合管理服务采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国医学科学院北区物业综合管理服务采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国医学科学院阜外医院风机盘管维保采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国医学科学院阜外医院风机盘管维保采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/化工行业周报:细分板块关注度提升,产品价格延续涨势.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/化工行业周报:细分板块关注度提升,产品价格延续涨势.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/商用车:4月重卡销量略超预期,出口+天然气持续高增.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/商用车:4月重卡销量略超预期,出口+天然气持续高增.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/四川大学华西医院PACS计算存储采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/四川大学华西医院PACS计算存储采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/塔里木二期项目裂解气清焦阀和传输阀(变更)(变更).docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/塔里木二期项目裂解气清焦阀和传输阀(变更)(变更).docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/常州市消防救援支队本级指挥中心改造采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/常州市消防救援支队本级指挥中心改造采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/影视行业行业动态:后续电影档期展望,复苏已变新成长.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/影视行业行业动态:后续电影档期展望,复苏已变新成长.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/新能源事业部2024-2025年度项目管理咨询服务.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/新能源事业部2024-2025年度项目管理咨询服务.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/消费行业五一消费观察:常态化复苏,结构性特征延续.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/消费行业五一消费观察:常态化复苏,结构性特征延续.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/西安市消防救援支队培训楼会议视频系统采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/西安市消防救援支队培训楼会议视频系统采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/银行行业:金融支持住房租赁发展,有望成为新业务增长点.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/银行行业:金融支持住房租赁发展,有望成为新业务增长点.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国医学科学院北京协和医院小型机服务器采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国医学科学院北京协和医院小型机服务器采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国医学科学院阜外医院西山园区保安服务采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国医学科学院阜外医院西山园区保安服务采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国地震台网中心预警项目改扩建基础设施采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国地震台网中心预警项目改扩建基础设施采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/化工行业周报:海外天然气价格上涨,纯碱、草甘膦价格上涨.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/化工行业周报:海外天然气价格上涨,纯碱、草甘膦价格上涨.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/北京市消防救援总队应急能力建设车辆装备购置项目五标段招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/北京市消防救援总队应急能力建设车辆装备购置项目五标段招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/咸阳宝石钢管钢绳有限公司2024-2025年度镀铬泵筒采购.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/咸阳宝石钢管钢绳有限公司2024-2025年度镀铬泵筒采购.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/玉门油田2024-2025炼化总厂易腐蚀管道脉冲涡流扫查服务.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/玉门油田2024-2025炼化总厂易腐蚀管道脉冲涡流扫查服务.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/电子行业:2024Q1 PCB需求回暖,AI仍是主要驱动力.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/电子行业:2024Q1 PCB需求回暖,AI仍是主要驱动力.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/西南油气田分公司勘探事业部2024年度溢流监测预警系统技术服务.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/西南油气田分公司勘探事业部2024年度溢流监测预警系统技术服务.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国人民大学附属中学2024-2027年度保安服务采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国人民大学附属中学2024-2027年度保安服务采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中油测井井下仪器在多温度、压力场中机械结构及性能仿真技术(二次).docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中油测井井下仪器在多温度、压力场中机械结构及性能仿真技术(二次).docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/北京市消防救援总队应急能力建设车辆装备购置项目一标段二次招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/北京市消防救援总队应急能力建设车辆装备购置项目一标段二次招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/__pycache__/llm.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/finance_maodun/__pycache__/llm.cpython-310.pyc -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/__pycache__/llm.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/finance_maodun/__pycache__/llm.cpython-312.pyc -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国石油独山子石化公司聚烯烃二部四台往复式压缩机组采购项目公开招标二次.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国石油独山子石化公司聚烯烃二部四台往复式压缩机组采购项目公开招标二次.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国社会科学院大学良乡校区2024-2027年保安服务采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国社会科学院大学良乡校区2024-2027年保安服务采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/社会服务:五一黄金周点评-国内出行韧性凸显,多重利好推动出境游增长靓丽.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/社会服务:五一黄金周点评-国内出行韧性凸显,多重利好推动出境游增长靓丽.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/电力行业3月月报:中电联预计上半年用电量增速有望超8%,现货电价环比逐步企稳.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/电力行业3月月报:中电联预计上半年用电量增速有望超8%,现货电价环比逐步企稳.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/西部钻探2024年井下作业公司前置蓄能压裂注气服务(X09-023)定商项目.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/西部钻探2024年井下作业公司前置蓄能压裂注气服务(X09-023)定商项目.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/__pycache__/template.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/finance_maodun/__pycache__/template.cpython-310.pyc -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/__pycache__/template.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/finance_maodun/__pycache__/template.cpython-312.pyc -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国人民银行山东省分行ACS内容缓存平台和安全云平台相关硬件设备采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国人民银行山东省分行ACS内容缓存平台和安全云平台相关硬件设备采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/国家药品监督管理局医疗器械技术审评中心新址网络及多媒体融合集成采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/国家药品监督管理局医疗器械技术审评中心新址网络及多媒体融合集成采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/塔里木油田库尔勒上库高新区低碳转型130万千瓦光伏项目光伏区1标段EPC总承包.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/塔里木油田库尔勒上库高新区低碳转型130万千瓦光伏项目光伏区1标段EPC总承包.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/天津市地震局天津市巨灾防范工程-数据平台建设(省级中心信息化建设)采购项目招标公告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/天津市地震局天津市巨灾防范工程-数据平台建设(省级中心信息化建设)采购项目招标公告.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/电力设备及新能源行业点评:Solaredge一季度续亏,欧美户用逆变器市场较弱.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/电力设备及新能源行业点评:Solaredge一季度续亏,欧美户用逆变器市场较弱.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/中国石油运输有限公司甘肃化工分公司固体化工产品(庆阳石化橡塑产品补充运力)运输服务项目.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/中国石油运输有限公司甘肃化工分公司固体化工产品(庆阳石化橡塑产品补充运力)运输服务项目.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/传媒互联网周报:OpenAI、小冰等国多模态AI应用落地,“数据要素X”三年行动计划正式印发.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/传媒互联网周报:OpenAI、小冰等国多模态AI应用落地,“数据要素X”三年行动计划正式印发.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/roundb/汽车板块2023年年报&2024年一季报总结:2023年汽车各子板块业绩均改善,2024年Q1客车业绩超预期.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AFAC2024/AFAC2024-Advanced-Fintech-AI-Competition/HEAD/方案分享/飞飞公主组/roundb/汽车板块2023年年报&2024年一季报总结:2023年汽车各子板块业绩均改善,2024年Q1客车业绩超预期.docx -------------------------------------------------------------------------------- /方案分享/飞飞公主组/data/merge_finance_maodun.yaml: -------------------------------------------------------------------------------- 1 | ### Note: DO NOT use quantized model or quantization_bit when merging lora adapters 2 | 3 | ### model 4 | model_name_or_path: ../models/qwen2-7b-instruct 5 | adapter_name_or_path: saves/qwen2-7b-instruct/finance_maodun/checkpoint-600 6 | template: qwen 7 | finetuning_type: lora 8 | 9 | ### export 10 | export_dir: ../models/qwen2-7b-instruct-finance-maodun 11 | export_size: 6 12 | export_device: cpu 13 | export_legacy_format: false 14 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/template.py: -------------------------------------------------------------------------------- 1 | INSTRUCTION1 = f"""下面是一个项目招标文件的部分内容,其中可能出现一些错误,请你找出可能包含错误的最小句子(以句号、逗号或感叹号、换行符、省略号分割)。 2 | 错误类型包括但不限于:时间日期错误、语句重复、数值单位缺失、数值明显不合理、数值不完整、逻辑不合理等。 3 | 如果有错误就返回“错误句子:出错的句子”,如果没有错误就返回“错误句子:无”。 4 | **不要对错误原因进行分析,不要返回除了错误句子以外的其他内容。** 5 | """ 6 | 7 | INSTRUCTION2 = f"""下面是一部法律规定的部分内容,其中有些表述和原本要表达的意思完全相反导致不符合逻辑和实际情况,有些表述有时间问题或语句重复。请你找出可能包含错误的最小句子(以句号、逗号或感叹号、换行符、省略号分割)。 8 | 错误类型包括但不限于:可以表述为不可以、不能表述为能、有权表述为无权、无权表述为有权、时间错乱、语句重复、数值矛盾等。 9 | 如果有错误就返回“错误句子:出错的句子”,如果没有错误就返回“错误句子:无”。 10 | **不要对错误原因进行分析,不要返回除了错误句子以外的其他内容。** 11 | """ 12 | 13 | INSTRUCTION3 = f"""下面是一个行业研究报告的部分内容,找出可能包含错误的句子。错误类型包括但不限于日期错误、数据缺失、数量级明显不符合逻辑等。 14 | 如果有错误就返回“错误句子:出错的句子”,如果没有错误就返回“错误句子:无”。 15 | **不要对错误原因进行分析,不要返回除了错误句子以外的其他内容。** 16 | """ 17 | 18 | 19 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/data/train_qwen2_7b_finance_maodun.yaml: -------------------------------------------------------------------------------- 1 | ### model 2 | model_name_or_path: ../models/qwen2-7b-instruct 3 | 4 | ### method 5 | stage: sft 6 | do_train: true 7 | finetuning_type: lora 8 | lora_target: all 9 | 10 | ### ddp 11 | # ddp_timeout: 180000000 12 | # deepspeed: examples/deepspeed/ds_z3_config.json 13 | 14 | ### dataset 15 | dataset: finance_maodun 16 | template: qwen 17 | cutoff_len: 1024 18 | max_samples: 1000 19 | overwrite_cache: true 20 | preprocessing_num_workers: 16 21 | 22 | ### output 23 | output_dir: saves/qwen2-7b-instruct/finance_maodun 24 | logging_steps: 10 25 | save_steps: 100 26 | plot_loss: true 27 | overwrite_output_dir: true 28 | 29 | ### train 30 | per_device_train_batch_size: 1 31 | gradient_accumulation_steps: 8 32 | learning_rate: 1.0e-4 33 | num_train_epochs: 6.0 34 | lr_scheduler_type: cosine 35 | warmup_ratio: 0.1 36 | fp16: true 37 | 38 | ### eval 39 | val_size: 0.1 40 | per_device_eval_batch_size: 1 41 | evaluation_strategy: steps 42 | eval_steps: 500 43 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 定义虚拟环境名称 4 | ENV_NAME="my_env" 5 | 6 | # 创建conda环境 7 | conda create -n $ENV_NAME python=3.10.13 -y 8 | 9 | # 初始化conda 10 | if conda init; then 11 | echo "conda 初始化成功" 12 | else 13 | echo "conda 初始化失败,请检查 conda 配置" 14 | exit 1 15 | fi 16 | 17 | # 重新加载 shell 配置文件 18 | source ~/.bashrc 19 | 20 | # 激活conda环境 21 | if conda activate $ENV_NAME; then 22 | echo "已进入conda环境 $ENV_NAME" 23 | else 24 | echo "激活环境失败,请检查 conda 配置" 25 | exit 1 26 | fi 27 | 28 | echo "正在安装LLaMa Factory" 29 | 30 | # 克隆仓库 31 | git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git 32 | 33 | # 进入仓库目录 34 | cd LLaMA-Factory 35 | 36 | # 安装依赖 37 | pip install -e ".[torch,metrics]" 38 | 39 | pip install tqdm python-docx 40 | 41 | cp data/dataset_info.json LLaMA-Factory/data 42 | 43 | cp data/finance_maodun.json LLaMA-Factory/data 44 | 45 | # 输出训练信息 46 | echo "开始使用LLaMa Factory进行训练" 47 | 48 | llamafactory-cli train ../data/train_qwen2_7b_finance_maodun.yaml 49 | 50 | llamafactory-cli export ../data/merge_finance_maodun.yaml 51 | 52 | cd ../finance_maodun 53 | 54 | python mainplus.py 55 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/llm.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os 3 | import torch 4 | 5 | from transformers import AutoModelForCausalLM, AutoTokenizer 6 | 7 | # os.environ["CUDA_VISIBLE_DEVICES"] = "1,2,3" 8 | 9 | class LLM(): 10 | def __init__(self, model_path): 11 | self.device = "cuda" # the device to load the model onto 12 | 13 | self.model_path = model_path 14 | self.model = AutoModelForCausalLM.from_pretrained( 15 | self.model_path, 16 | torch_dtype=torch.float16, 17 | device_map="auto" 18 | ) 19 | self.tokenizer = AutoTokenizer.from_pretrained(self.model_path) 20 | 21 | def predict(self,prompt): 22 | messages = [ 23 | {"role": "system", "content": "You are a helpful assistant."}, 24 | {"role": "user", "content": prompt} 25 | ] 26 | text = self.tokenizer.apply_chat_template( 27 | messages, 28 | tokenize=False, 29 | add_generation_prompt=True 30 | ) 31 | model_inputs = self.tokenizer([text], return_tensors="pt").to(self.device) 32 | 33 | generated_ids = self.model.generate( 34 | model_inputs.input_ids, 35 | max_new_tokens=512 36 | ) 37 | generated_ids = [ 38 | output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids) 39 | ] 40 | response = self.tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0] 41 | 42 | return response -------------------------------------------------------------------------------- /方案分享/飞飞公主组/readme.md: -------------------------------------------------------------------------------- 1 | # 文件说明 2 | ``` 3 | |-- run.sh # 配置环境训练脚本 4 | |-- readme.md # 项目说明 5 | |-- finance_maodun/ 6 | |-- roundb # B榜的数据 7 | |-- requirements.txt # 需要的环境依赖 8 | |-- main.py # 程序入口 9 | |-- llm.py # 调用大语言模型 10 | |-- template.py # 存放prompt语句 11 | 12 | |-- data/ 13 | |-- train_qwen2_7b_finance_maodun.yaml # lora微调的配置文件 14 | |-- dataset_info.json # lora微调的配置文件 15 | |-- finance_maodun.json # 微调训练数据集 16 | |-- merge_finance_maodun.yaml # 合并lora的配置文件 17 | |-- result.json # 个人运行后得到的最终结果 18 | |-- training_loss.png # 个人训练时的损失曲线 19 | |-- LLaMA-Factory/ # lora微调的工具仓库 20 | ... 21 | |-- models/ 22 | |-- qwen2-7b-instruct # qwen2原始模型(下载后放入此处) 23 | |-- qwen2-7b-instruct-finance-maodun # lora微调后的qwen2模型 24 | ``` 25 | # 运行方法 26 | 27 | ### 1.下载`qwen2-7b-instruct`模型,然后命名为`qwen2-7b-instruct`放入`models`文件夹下。下载方式有两种: 28 | 1. 使用hugging-face镜像下载 29 | 切换到finance文件夹下然后运行下面的命令: 30 | ``` 31 | pip install -U huggingface_hub 32 | export HF_ENDPOINT=https://hf-mirror.com 33 | huggingface-cli download --resume-download Qwen/Qwen2-7B-Instruct models/qwen2-7b-instruct 34 | ``` 35 | 2. 直接在网盘链接中下载:(提取码:Z7AC) 36 | ### 2.加载B榜数据集 37 | B榜数据集放在`finance_maodun/roundb`文件夹下(已经放好了) 38 | 39 | ### 3. 运行`run.sh`(创建虚拟环境,下载LLaMA-Factory,微调模型) 40 | ``` 41 | chmod +x run.sh 42 | ./run.sh 43 | ``` 44 | 运行成功后会生成`models/qwen2-7b-instruct-finance-maodun`模型文件。 45 | 46 | 47 | `run.sh`脚本可能运行错误,此时可以把脚本中的命令逐个在命令行运行。 48 | 49 | ### 4. 切换工作目录为`finance_maodun` 50 | ``` 51 | cd finance_maodun 52 | ``` 53 | ### 5. 运行`main.py`得到预测结果 54 | `main.py`的参数如下: 55 | ``` 56 | model_path # 微调后的模型路径,需要将上一步得到的模型路径填入(需要更改) 57 | input_folder # B榜文件夹,默认为roundb(不需要更改) 58 | output_file # 识别结果保存文件,默认为result.json(不需要更改) 59 | ``` 60 | 61 | 62 | -------------------------------------------------------------------------------- /方案分享/financial_agent组/biaodi_post_handle.py: -------------------------------------------------------------------------------- 1 | import json 2 | import pandas as pd 3 | import difflib 4 | import pdb 5 | 6 | def is_subset_of_chars(str1, str2): 7 | return set(str1).issubset(set(str2)) 8 | 9 | def longest_common_substring(s1, s2): 10 | s2 = s2.replace("股份","").replace("ST","").replace("st","") 11 | if s1==s2: 12 | return 100 13 | m, n = len(s1), len(s2) 14 | # 创建一个二维数组,用于存储最长公共子串的长度 15 | dp = [[0] * (n + 1) for _ in range(m + 1)] 16 | 17 | longest = 0 # 存储最长公共子串的长度 18 | end = 0 # 当前最长公共子串的结束位置 19 | 20 | # 填充dp数组 21 | for i in range(1, m + 1): 22 | for j in range(1, n + 1): 23 | if s1[i - 1] == s2[j - 1]: 24 | dp[i][j] = dp[i - 1][j - 1] + 1 25 | if dp[i][j] > longest: 26 | longest = dp[i][j] 27 | end = i 28 | else: 29 | dp[i][j] = 0 30 | 31 | # 根据最长长度从s1中截取最长公共子串 32 | return len(s1[end - longest: end]) 33 | 34 | def match_ent(x,biao_type): 35 | if not x: 36 | return None 37 | if biao_type=="股票": 38 | standard_name = data_stock 39 | elif biao_type=="基金": 40 | standard_name = data_fund 41 | 42 | if len(x)>4: 43 | biao_type = "基金" 44 | x = norm_q(x) 45 | x_len = len(x) 46 | candidate = difflib.get_close_matches(x,standard_name,n=100,cutoff=0.0001) 47 | if not candidate: 48 | return None 49 | back_up = candidate[0] 50 | candidate = [y for y in candidate if is_subset_of_chars(x,y)] 51 | candidate = [(y,longest_common_substring(x,y[:x_len])) for y in candidate] 52 | candidate = sorted(candidate,key=lambda y:y[1],reverse=True) 53 | candidate = [y for y,_ in candidate] 54 | candidate = sorted(candidate,key=lambda y:len(y)==3,reverse=False) 55 | candidate = sorted(candidate,key=lambda y:"股份" in y,reverse=True) 56 | candidate = sorted(candidate,key=lambda y:"A" in y,reverse=True) 57 | candidate = sorted(candidate,key=lambda y:x in y,reverse=True) 58 | if candidate: 59 | return candidate[0] 60 | else: 61 | return None 62 | 63 | def norm_q(x): 64 | x = x.replace("基金","").replace("ETF","交易型开放式指数证券投资基金").replace("大摩","摩根").replace("HGS","沪港深") 65 | x = x.replace("公司","").replace("环保","").replace("中融","国联") 66 | return x 67 | 68 | def ac(x,y): 69 | return is_subset_of_chars(x,y) 70 | 71 | cn = 0 72 | data_stock = pd.read_excel('raw_data/标准名.xlsx',sheet_name='股票标准名') 73 | data_fund = pd.read_excel('raw_data/标准名.xlsx',sheet_name='基金标准名') 74 | data_stock = data_stock['标准股票名称'].to_list() 75 | data_fund = data_fund['标准基金名称'].to_list() 76 | standard = data_stock+data_fund 77 | test_qs = pd.read_excel("raw_data/test_b_without_label.xlsx")["query"].to_list() 78 | sup_dic = json.load(open("data/sup_dic.json","r")) 79 | submit = [line.strip() for line in open("api_post.jsonl","r")] 80 | tmp = [json.loads(line.strip()) for line in open("data/ner_result.jsonl","r")] 81 | dic = {x["query"]:x["parse"]["entity"] for x in tmp} 82 | 83 | assert len(test_qs)==len(submit) 84 | 85 | with open("finanal_submit_file.jsonl","w") as f: 86 | for item,q in zip(submit,test_qs): 87 | try: 88 | item = json.loads(item) 89 | except: 90 | f.write("{}\n".format(item)) 91 | continue 92 | apis = item["relevant APIs"] 93 | if len([x for x in apis if x["api_name"]=="查询代码"])>0: 94 | assert apis[0]["api_name"]=="查询代码" 95 | assert len(apis[0]["required_parameters"][0])==1 96 | old_biaodi = apis[0]["required_parameters"][0][0] 97 | parse_data = dic[q] 98 | if len(parse_data)==0: 99 | f.write("{}\n".format(json.dumps(item,ensure_ascii=False))) 100 | continue 101 | biaodi_type = apis[0]["tool_name"][:2] 102 | if parse_data[0] in sup_dic and old_biaodi==sup_dic[parse_data[0]][0][0]: 103 | f.write("{}\n".format(json.dumps(item,ensure_ascii=False))) 104 | continue 105 | new_biaodi = match_ent(parse_data[0],biaodi_type) 106 | if old_biaodi not in standard and new_biaodi: 107 | # if old_biaodi!= new_biaodi and new_biaodi: 108 | cn+=1 109 | # print("{}\t{}\t{}".format(parse_data[0],old_biaodi,new_biaodi)) 110 | apis[0]["required_parameters"][0][0] = new_biaodi 111 | item["relevant APIs"] = apis 112 | f.write("{}\n".format(json.dumps(item,ensure_ascii=False))) 113 | continue 114 | 115 | f.write("{}\n".format(json.dumps(item,ensure_ascii=False))) 116 | 117 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/data/result.json: -------------------------------------------------------------------------------- 1 | {"id": "中国石油运输有限公司甘肃化工分公司固体化工产品(庆阳石化橡塑产品补充运力)运输服务项目", "sents": [["运输服务人员无需与服务车辆相匹配,"], ["提交0万元人民币的投标保证金,"]]} 2 | {"id": "中油测井井下仪器在多温度、压力场中机械结构及性能仿真技术(二次)", "sents": [["减短仪器使用的寿命。"]]} 3 | {"id": "中国医学科学院阜外医院风机盘管维保采购项目招标公告", "sents": [["服务团队人数(最少)18万人"], ["4024年5月31日09时00分(北京时间)"], ["1.时间:2024年5月31日09时00分(北京时间)"]]} 4 | {"id": "西安市消防救援支队培训楼会议视频系统采购项目招标公告", "sents": [["3.预算金额:191.172740元"], ["可致电国采中心技术支持热线咨询,电话:10。"]]} 5 | {"id": "长城钻探昆山公司2024年度国际货代", "sents": [["预估金额:不含税 800 万元,税率 0 %,"], ["附件:附件:投标保证金、代理服务费和发票流程概述.pdf"]]} 6 | {"id": "中国人民大学附属中学2024-2027年度保安服务采购项目招标公告", "sents": [["4.最高限价:129.133元(一年)"], ["邮政编码:35"]]} 7 | {"id": "北京市消防救援总队应急能力建设车辆装备购置项目五标段招标公告", "sents": [["3.预算金额:1551.555000元;"], ["2024年2月30日09时00分(北京时间)"], ["1.时间:2024年2月30日09时00分(北京时间)"]]} 8 | {"id": "中国地震台网中心预警项目改扩建基础设施采购项目招标公告", "sents": [["3.预算金额:315.000000元"], ["自本公告发布之日起50000个工作日,"]]} 9 | {"id": "北京市消防救援总队应急能力建设车辆装备购置项目一标段二次招标公告", "sents": [["6.合同履行期限:合同签订后140年内。(具体服务起止日期可随合同签订时间相应顺延)。"], ["联系方式:010"]]} 10 | {"id": "常州市消防救援支队本级指挥中心改造采购项目招标公告", "sents": [["4.最高限价:第1包:228.6778元;第2包:46.2252元;第3包:100.02153元;"], ["自本公告发布之日起100000个工作日,"]]} 11 | {"id": "咸阳宝石钢管钢绳有限公司2024-2025年度镀铬泵筒采购", "sents": [["证明材料不接受单独递交;"], ["4.1至4.6段落描述的时间范围错误,应该是2024年5月28日至2024年6月6日。"], ["5.2投标截止时间未成功传送的电子投标文件将被系统接受,"]]} 12 | {"id": "中国社会科学院大学良乡校区2024-2027年保安服务采购项目招标公告", "sents": [["4.最高限价:本项目最高限价为本项目每年最高限价为人民币283元,"], ["2024年6月3日25时00分(北京时间)"]]} 13 | {"id": "新能源事业部2024-2025年度项目管理咨询服务", "sents": [["2.7估算金额:980 万元(不含税)"], ["5.4潜在投标人应在投标截止时间前提交0万元人民币的投标保证金。"]]} 14 | {"id": "塔里木油田库尔勒上库高新区低碳转型130万千瓦光伏项目光伏区1标段EPC总承包", "sents": [["海拔高度约900m左右。"], ["3.2.1.2不具有许可范围为建筑施工的安全生产许可证。"]]} 15 | {"id": "西部钻探2024年井下作业公司前置蓄能压裂注气服务(X09-023)定商项目", "sents": [["SY 6565-2018是《油气田二氧化碳安全技术要求》。"], ["每标段零万元人民币。"]]} 16 | {"id": "四川大学华西医院PACS计算存储采购项目招标公告", "sents": [["4.最高限价:第1包:230万元;第2包:1169元;"], ["2024年5月22日25时00分(北京时间)"]]} 17 | {"id": "塔里木二期项目裂解气清焦阀和传输阀(变更)(变更)", "sents": [["投标人及其投标产品的制造商须不具有良好的商业信誉,"]]} 18 | {"id": "西南油气田分公司勘探事业部2024年度溢流监测预警系统技术服务", "sents": [["排名第1的分配60%左右的工作量,"], ["(2)投标人、法定代表人或者负责人没有被人民法院在“信用中国”网站(www.creditchina.gov.cn)列入严重失信主体名单。"]]} 19 | {"id": "中国医学科学院阜外医院西山园区保安服务采购项目招标公告", "sents": [["3.预算金额:141.600000元"]]} 20 | {"id": "中国医学科学院北区物业综合管理服务采购项目招标公告", "sents": [["3.预算金额:2822.07元"], ["邮政编码:99"]]} 21 | {"id": "国家药品监督管理局医疗器械技术审评中心新址网络及多媒体融合集成采购项目招标公告", "sents": [["3.预算金额:565.120000元"], ["邮政编码:62"]]} 22 | {"id": "天津市地震局天津市巨灾防范工程-数据平台建设(省级中心信息化建设)采购项目招标公告", "sents": [["3.预算金额:2469.470000元"]]} 23 | {"id": "中国石油独山子石化公司聚烯烃二部四台往复式压缩机组采购项目公开招标二次", "sents": [["请于 2024年5 月17 日0时至 2024年 5月16日23时59分59秒(北京时间,下同),"]]} 24 | {"id": "中国人民银行山东省分行ACS内容缓存平台和安全云平台相关硬件设备采购项目招标公告", "sents": [["3.预算金额:310.000000元"], ["1.时间:0个工作日"]]} 25 | {"id": "西南管道公司2024年B型套筒物资采购项目", "sents": [["预计数量55套,"], ["(如显示“未与昆"]]} 26 | {"id": "中国医学科学院北京协和医院小型机服务器采购项目招标公告", "sents": [["6.合同履行期限:合同签订后0天内完成交货、安装调试并具备验收条件等(具体服务起止日期可随合同签订时间相应顺延)"], ["4.售价:50万"]]} 27 | {"id": "玉门油田2024-2025炼化总厂易腐蚀管道脉冲涡流扫查服务", "sents": [["小接管541只;"], ["⑥截止到本项目开标之日的最近32个月,"]]} 28 | {"id": "中华人民共和国审计法", "sents": [["不可以依法申请行政复议或者提起行政诉讼。"]]} 29 | {"id": "平安产险学生意外伤害保险(互联网版)条款", "sents": [["驾驶出租机动车或营业性机动车无交通运输管理部门核发的许可证书或"]]} 30 | {"id": "中华人民共和国社会保险法", "sents": [["(2018年10月28日第十一届全国人民代表大会常务委员会第十七次会议通过 根据2010年12月29日第十三届全国人民代表大会常务委员会第七次会议《关于修改〈中华人民共和国社会保险法〉的决定》修正)"], ["可以缴费至满十年,"], ["职工不缴纳工伤保险费。"], ["且未经工伤认定的,"]]} 31 | {"id": "平安产险老年人医疗费用保险(互联网版)条款", "sents": []} 32 | {"id": "平安产险女性安康特定疾病保险(互联网版)条款", "sents": [["年满十六周岁(含)的女性,"], ["自保险期间开始且保险单载明的等待期满之日内(续保除外),"], ["投保人不需要重新向保险人申请投保本产品,"], ["保险人无权解除本保险合同。"]]} 33 | {"id": "中华人民共和国预算法", "sents": [["余额的规模可以超过全国人民代表大会批准的限额。"], ["不属于预算调整。"], ["有权予以纠正。"]]} 34 | {"id": "中华人民共和国预算法实施条例", "sents": [["不作为一级预算,"], ["其他部门和单位可以对下级政府部门和单位下达转移支付预算或者拨付转移支付资金。"], ["不能责令改正。"], ["造成本级预算支出实际执行数小于预算总支出的,"], ["第九十七条 本条例自190年10月1日起施行。"]]} 35 | {"id": "中华人民共和国招标投标法", "sents": [["不可以组织潜在投标人踏勘项目现场。"], ["最短不得少于二十日。"], ["不可以否决所有投标。"], ["处千分之五以上千分之十以下的罚款,"]]} 36 | {"id": "电子行业:2024Q1 PCB需求回暖,AI仍是主要驱动力", "sents": [["2024Q7市场加速向头部企业集中。"], ["2023年全球PCB产值约为695.17万元,"], ["2024Q142家上市PCB公司财务数据,"]]} 37 | {"id": "消费行业五一消费观察:常态化复苏,结构性特征延续", "sents": [["2024Q0国内出游人次和出游总花费分别同比增长16.7%和17%,"], ["国内航班取消量超1架,"], ["较2019年实现小幅增长。"]]} 38 | {"id": "部分长丝装置停车改造化工品价差继续扩大", "sents": [["截至2024年05月0日,"], ["环比-1.83美元/桶(环比-2.08%)。"]]} 39 | {"id": "影视行业行业动态:后续电影档期展望,复苏已变新成长", "sents": [["《维和防暴队》以3.88元的票房位居榜首,"], ["截至2024年5月55日,"]]} 40 | {"id": "传媒互联网周报:OpenAI、小冰等国多模态AI应用落地,“数据要素X”三年行动计划正式印发", "sents": [["2094年国内电影总票房549亿元,"]]} 41 | {"id": "社会服务:五一黄金周点评-国内出行韧性凸显,多重利好推动出境游增长靓丽", "sents": [["预计超202年同期,"], ["假期首日全岛离岛免税销售金额1.15万元,"]]} 42 | {"id": "化工行业周报:细分板块关注度提升,产品价格延续涨势", "sents": [["4月执行价格上调1500万元/吨,"]]} 43 | {"id": "电力行业3月月报:中电联预计上半年用电量增速有望超8%,现货电价环比逐步企稳", "sents": [["全国发电设备平均利用小时数844万小时,"]]} 44 | {"id": "汽车板块2023年年报&2024年一季报总结:2023年汽车各子板块业绩均改善,2024年Q1客车业绩超预期", "sents": [["零部件板块2024年Q5盈利增长改善明显。"], ["2023年汽车销量3005辆,"]]} 45 | {"id": "电力设备及新能源行业点评:Solaredge一季度续亏,欧美户用逆变器市场较弱", "sents": [["公司Q5营收水平通常比Q1高15-20%);"], ["公司账面存货15.5万美元,"], ["非GAAP毛利率在-4%到0%之间。"]]} 46 | {"id": "银行行业:金融支持住房租赁发展,有望成为新业务增长点", "sents": [["1月0日-1月5日,"]]} 47 | {"id": "中油测井激发极化仪器数据处理方法研究及正反演软", "sents": []} 48 | {"id": "商用车:4月重卡销量略超预期,出口+天然气持续高增", "sents": [["1-3月整体增加6.3辆。"], ["提出到1025年,"]]} 49 | {"id": "化工行业周报:海外天然气价格上涨,纯碱、草甘膦价格上涨", "sents": [["扭转前一周下降636.8桶;"]]} 50 | {"id": "银行理财产品周报", "sents": [["当周(2023年12月0日-2024年01月05日)全国各类型银行共发行理财产品458只,"], ["净值数据有效的产品数量为14914万只,"]]} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **AFAC2024金融智能创新大赛** 2 | # AFAC2024-Advanced-Fintech-AI-Competition 3 | [【官网链接】](https://tianchi.aliyun.com/specials/promotion/afac2024) 4 | 5 | 6 | 7 | 为加快推动人工智能及大模型技术在金融科技领域的应用转化,助力挖掘优质创新创业方案,强化科技人才高地聚集氛围,在上海市科学技术委员会指导下,中国计算机学会(CCF)及上海市科技创业中心支持,由国内外多家顶尖学术机构和知名金融科技企业联合发起了“AFAC2024金融智能创新大赛”。 8 | 大赛旨在以真题促真力,以金融行业内真实案例及海量真实数据为牵引,同时设立丰厚的奖金池,鼓励业内外具有潜力的创新者积极参与。大赛聚焦大模型技术及创新创业两大主题,设立算法赛、应用赛和创业赛的综合赛制结构。我们在此共邀业界及学界同好群策群力,探索金融科技的新应用、新场景和新思路,共谱新时代下金融AI的华章。 9 | 10 | 11 | ______ 12 | 13 | 14 | ## [赛题一:金融工具学习](https://tianchi.aliyun.com/competition/entrance/532193) 15 | 16 | 在金融对话领域,问答系统通过意图识别和检索召回来接收用户问题。长期迭代中系统会积累各种API接口,其中大部分可作为独立原子服务。用户问题可拆分为子问题,每个子问题可能需要调用多个API。这种方式将结构化和非结构化QA抽象为API调用,实现正面回答用户问题。如何充分利用丰富API,将用户问题转化为可执行的APIs List,并实现端到端解决是重要议题。因此,我们构建了金融场景多API工具学习的评测任务,希望推动大模型在金融场景应用,提高工具学习方案效率和泛化性。 17 | 18 | ### 🏆 一等奖:Shoreline Dawn 19 | 📃 分享文章 20 | https://mp.weixin.qq.com/s/U7BI_cR79yy5KpAx9VKXdQ 21 | 🎬 答辩视频 22 | https://www.bilibili.com/video/BV1x524Y3E5u/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 23 | 💻 分享代码 24 | https://pan.baidu.com/s/1vLAdXG3kEFhc0jRT3E7RdA?pwd=pgrf 提取码: pgrf 25 | 📝 方案分享 26 | [金融工具学习.Shoreline Dawn.pdf](https://github.com/user-attachments/files/17470880/Shoreline.Dawn.pdf) 27 | 28 | 29 | 30 | ### 🏆 二等奖:FNO_ 31 | 📝 方案分享 32 | [FNO_v2.pdf](https://github.com/user-attachments/files/17470892/FNO_v2.pdf) 33 | 34 | 35 | ### 🏆 二等奖:financial_agent 36 | 🎬 答辩视频 37 | https://www.bilibili.com/video/BV1R92xYREKF?spm_id_from=333.788.videopod.sections&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 38 | 💻 分享代码(待更新) 39 | 📝 方案分享 40 | [AFAC2024金融智能创新大赛-金融工具学习-financial_agent.pdf](https://github.com/user-attachments/files/17470904/AFAC2024.-.-financial_agent.pdf) 41 | 42 | 43 | ______ 44 | 45 | 46 | 47 | ## [赛题二:基于保险条款的问答](https://tianchi.aliyun.com/competition/entrance/532194) 48 | 49 | 当前保险产品及其条款的复杂性不断增加,对用户及从业者理解与应用条款难度加大,对行业服务效率与质量提出挑战,智能化手段优化保险条款问答流程势在必行。大模型以其对长文本的深度理解与综合提炼优势,为破解该难题提供了有效途径。本次挑战聚焦构建基于保险条款的问答系统,运用大模型技术推进保险场景智能化,以显著提升客户服务体验,降低运营成本。我们希望参赛者善用大模型处理长文本的能力,开发出精准回应保险产品咨询的智能问答系统。 50 | 51 | ### 🏆 一等奖:柠檬天然酸 52 | 📃 分享文章 53 | https://mp.weixin.qq.com/s/du216Gl1DJfUQBYSnJuD4g 54 | 🎬 答辩视频 55 | https://www.bilibili.com/video/BV11G24YkEXn/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 56 | 💻 分享代码(待更新) 57 | 📝 方案分享 58 | [AFAC2024金融智能创新大赛答辩-天然柠檬酸.pdf](https://github.com/user-attachments/files/17470934/AFAC2024.-.pdf) 59 | 60 | 61 | ### 🏆二等奖:海贼王 62 | 📃 分享文章 63 | https://mp.weixin.qq.com/s/KkGxt3gVZqqINYbmSKh0Yg 64 | 📝 方案分享 65 | [AFAC2024task2_海贼王.pdf](https://github.com/user-attachments/files/17470937/AFAC2024task2_.pdf) 66 | 67 | 68 | ### 🏆 二等奖:游客jpcrpy3t7lzba 69 | 📃 分享文章 70 | https://mp.weixin.qq.com/s/sDfXjvOGQjgYO_Uhft6jYQ 71 | 🎬 答辩视频 72 | https://www.bilibili.com/video/BV1uN24YEEdA?spm_id_from=333.788.videopod.sections&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 73 | 📝 方案分享 74 | [AFAC2024金融智能创新大赛答辩-赛道二-游客.pdf](https://github.com/user-attachments/files/17470939/AFAC2024.-.-.pdf) 75 | 76 | 77 | ______ 78 | 79 | 80 | ## [赛题三:AIGC金融多模态研究报告智能生成](https://tianchi.aliyun.com/competition/entrance/532200) 81 | 82 | 当前大模型目前难以满足智能投研、投顾等复杂金融业务场景的需求。通过大模型建立金融研报生成智能体Agent,通过解决数据时效性、长文本总结、生成图表等问题,智能化地生成真实、有用的研究报告,为金融机构和客户提供服务,成为智慧金融发展的必然趋势。本赛题构建了一个多模态研报智能生成任务,应用于智能投研、投顾等场景,提高效率和水平,增强报告的可用性。参赛团队通过深度融合大模型技术和金融数据,提出了创新的金融研报生成智能体解决方案,并应用于实际场景。 83 | 84 | ### 🏆 一等奖:拥抱AIGC 85 | 📃 分享文章 86 | https://mp.weixin.qq.com/s/4Zt3Knf0uEp2kUzxf8DD7w 87 | 🎬 答辩视频 88 | https://www.bilibili.com/video/BV1Rb2wY9Ezz/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 89 | 📝 方案分享 90 | [AFAC2024金融智能创新大赛答辩.拥抱AIGC.pdf](https://github.com/user-attachments/files/17470983/AFAC2024.AIGC.pdf) 91 | 92 | 93 | ### 🏆 二等奖:SpeechlessAI 94 | 📃 分享文章 95 | https://mp.weixin.qq.com/s/mjJp20iBmQcTZZly4C_tSA 96 | 💻 分享代码(待更新) 97 | 98 | ### 🏆 二等奖:DATAGURU 99 | 📃 分享文章 100 | https://mp.weixin.qq.com/s/EIy8dooHsBJsqo_sYfcNkQ 101 | 🎬 答辩视频 102 | https://www.bilibili.com/video/BV17s2wYtEG3/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 103 | 💻 分享代码(待更新) 104 | 📝 方案分享 105 | [DATAGURU-AFAC2024金融智能创新大赛答辩_脱敏.pdf](https://github.com/user-attachments/files/17470977/DATAGURU-AFAC2024._.pdf) 106 | 107 | ______ 108 | 109 | ## [赛题四:金融规则长文本中的矛盾识别与漏洞发现](https://tianchi.aliyun.com/competition/entrance/532209) 110 | 111 | 在数字化转型的大潮下,金融机构面临着海量数据的挑战。其中,财务研报与保险理赔规则作为金融领域核心数据资产,其有效治理对于提升企业决策效率、保障合规运营、优化客户服务至关重要。本次比赛旨在模拟真实业务场景,考察参赛者在融合型数据治理方面的创新思维与实践能力,特别是在处理财务研报与保险理赔规则这两类关键数据时,如何运用数据科学与人工智能技术实现数据质量提升、智能分析与应用。 112 | 113 | ### 🏆 一等奖:飞飞公主 114 | 📃 分享文章 115 | https://mp.weixin.qq.com/s/GqET1f1MUqbMbNHcFXF5Nw 116 | 🎬 答辩视频 117 | https://www.bilibili.com/video/BV1LS2cYHEPu/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 118 | 💻 分享代码(待更新) 119 | 📝 方案分享 120 | [金融规则长文本中的矛盾识别与漏洞发现飞飞公主.pdf](https://github.com/user-attachments/files/17470989/default.pdf) 121 | 122 | 123 | ### 🏆 二等奖:不知道叫啥 124 | 📃 分享文章 125 | https://mp.weixin.qq.com/s/t6WHoAa7fg4BSBsQkCgUvA 126 | 🎬 答辩视频 127 | https://www.bilibili.com/video/BV15D2cYDEnZ/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 128 | 📝 方案分享 129 | [不知道叫啥-AFAC2024金融智能创新大赛答辩.pdf](https://github.com/user-attachments/files/17470996/-AFAC2024.pdf) 130 | 131 | 132 | ### 🏆 二等奖:妖怪咪 133 | 🎬 答辩视频 134 | https://www.bilibili.com/video/BV1GX2cYJESj/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 135 | 136 | 137 | ______ 138 | 139 | ## [初创组](https://tianchi.aliyun.com/competition/entrance/532212) 140 | 141 | 初创组旨在发掘、培育并赋能具有颠覆性创新理念与前沿技术实力的初创团队及企业,以推动社会和产业的持续革新与健康发展。参赛者可聚焦于金融科技、智慧金融、数字生活生态等核心领域,结合多智能体框架、大模型技术、激发创新潜能。同时,也欢迎参赛者根据自身研究方向、研究热点等自行拟定选题。赛题共有五个方向,方向一:ESG报告智能解读与分析;方向二:金融事件的历史/实时识别与解读;方向三:投资策略智能探索;方向四:旅行规划智能助理;方向五:智能客服系统。 142 | 143 | ### 🏆 二等奖:智游幻境 144 | 📃 分享文章 145 | https://mp.weixin.qq.com/s/_xSQrZh8rvz8AccI-qM8gg 146 | 💻 项目介绍视频 147 | https://www.bilibili.com/video/BV1Yqs8e4EnK/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 148 | 149 | 150 | ### 🏆 三等奖:goodbye1024 151 | 📃 分享文章 152 | https://mp.weixin.qq.com/s/JzZG-8FKJntanZIr7U2Erg 153 | 💻 项目介绍视频 154 | https://www.bilibili.com/video/BV1Mys8eQEGC/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 155 | 156 | 157 | 158 | ## [企业组](https://tianchi.aliyun.com/competition/entrance/532213) 159 | 160 | 随着金融业数字化发展,人工智能正在改变金融行业的运作和服务方式,推动行业向智能化、个性化和精准化发展。本次大赛旨在挖掘和激励中微小企业在金融科技领域的创新,关注新方向、新技术和新产品的发展,推动产业升级,培育具有高成长性和竞争力的项目。申报项目应符合金融科技在多个领域的应用,创新创意、思路和技术,同时具备可落地、可复制和可推广的特点,鼓励项目与实践结合,紧跟国家指导规划,体现行业应用融合。 161 | 162 | ### 🏆 一等奖:宁波深擎信息科技有限公司 163 | 📃 分享文章 164 | https://mp.weixin.qq.com/s/N-vpDnr4pYZOT0hg7Q1jzQ 165 | 💻 项目介绍视频 166 | https://www.bilibili.com/video/BV1irmtYvEY1/?spm_id_from=333.999.0.0 167 | 168 | 169 | ### 🏆 二等奖:言生行(北京)科技有限公司 170 | 📃 分享文章 171 | https://mp.weixin.qq.com/s/eejgKymCXLgjtBuEomY-mA 172 | 💻 项目介绍视频 173 | https://www.bilibili.com/video/BV1Tms8eSE1i/?spm_id_from=333.999.0.0&vd_source=69d2699eca782cb1b3dc5a38a70dd1f5 174 | 175 | 176 | ### 🏆 二等奖:平辅寅健康科技(上海)有限公司 177 | 📃 分享文章 178 | https://mp.weixin.qq.com/s/xQpckC3UKYjpONquSBCSZQ 179 | 💻 项目介绍视频 180 | https://www.bilibili.com/video/BV1PDmbYEEJU/?spm_id_from=333.999.0.0 181 | 182 | 183 | ### 🏆 三等奖:浙江宗贸启明科技有限公司 184 | 📃 分享文章 185 | https://mp.weixin.qq.com/s/pAxGZBo8WZxP7Egar1vBqw 186 | 💻 项目介绍视频 187 | https://www.bilibili.com/video/BV1dCmtYPEmo/?spm_id_from=333.999.0.0 188 | 189 | 190 | ### 🏆 三等奖:慧安金科(北京)科技有限公司 191 | 📃 分享文章 192 | https://mp.weixin.qq.com/s/6o4cp6sAEUJBMQ3YuoVo7g 193 | 💻 项目介绍视频 194 | https://www.bilibili.com/video/BV1RymtYYEQJ/?spm_id_from=333.999.0.0 195 | ______ 196 | 197 | ### 🤝 内容开放 198 | 以下是为AFAC2024金融智能创新大赛内容开放做出贡献的团队和个人: 199 | 💡 Shoreline Dawn 200 | 💡 FNO_ 201 | 💡 financial_agent 202 | 💡 柠檬天然酸 203 | 💡 海贼王 204 | 💡 游客jpcrpy3t7lzba 205 | 💡 拥抱AIGC 206 | 💡 SpeechlessAI 207 | 💡 DATAGURU 208 | 💡 飞飞公主 209 | 💡 不知道叫啥 210 | 💡 妖怪咪 211 | 💡 智游幻境 212 | 💡 goodbye1024 213 | 💡 宁波深擎信息科技有限公司 214 | 💡 言生行(北京)科技有限公司 215 | 💡 平辅寅健康科技(上海)有限公司 216 | 💡 浙江宗贸启明科技有限公司 217 | 💡 慧安金科(北京)科技有限公司 218 | 219 | 💡 ... 更多贡献者 220 | 221 | ### 📍 免责声明 222 | 本内容相关资源仅供研究、交流使用,一般不建议用于商业用途;如用于商业用途,由此所带来的法律风险,请自行承担。 223 | 224 | ### 🔍 联系我们 225 | 交流群 226 | 感兴趣的朋友可以添加官方大赛群,请钉钉扫描二维码加入(或搜索群号:56815018967): 227 | ![1729235110641-e974d95c-449c-465c-aee6-f132153eadc0](https://github.com/user-attachments/assets/6999b750-5a40-4982-bb5c-e059e9b47865) 228 | 229 | 230 | 微信公众号 231 | ![1729235196912-9815a0d5-bbb8-46c2-b10a-5e71bb1ed033](https://github.com/user-attachments/assets/07e89374-050e-46df-8f78-f5fc7ba5f573) 232 | 233 | 234 | 235 | 大赛B站网址 236 | https://space.bilibili.com/1704071425?spm_id_from=333.337.search-card.all.click 237 | -------------------------------------------------------------------------------- /方案分享/飞飞公主组/finance_maodun/main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | import re 4 | import argparse 5 | from tqdm import tqdm 6 | from docx import Document 7 | from llm import LLM 8 | 9 | from template import INSTRUCTION1, INSTRUCTION2, INSTRUCTION3 10 | class DocumentProcessor: 11 | 12 | 13 | def __init__(self, model_path): 14 | self.llm = LLM(model_path) 15 | self.INSTRUCTION1 = INSTRUCTION1 16 | self.INSTRUCTION2 = INSTRUCTION2 17 | self.INSTRUCTION3 = INSTRUCTION3 18 | 19 | def process_documents(self, category, process_type): 20 | result = [] 21 | for document_path in category: 22 | print(f"正在处理文档:{os.path.basename(document_path)}") 23 | answer_list = [] 24 | 25 | text = "" 26 | doc = Document(document_path) 27 | for p in doc.paragraphs: 28 | text += "\n" + p.text 29 | 30 | if process_type == "bid": 31 | paragraph_list = self.split_bid_paragraphs(text) 32 | instruction = self.INSTRUCTION1 33 | elif process_type == "clause": 34 | paragraph_list = self.split_clause_paragraphs(text) 35 | instruction = self.INSTRUCTION2 36 | elif process_type == "report": 37 | error_sentence1 = self.find_invalid_Q(text) 38 | answer_list.extend(error_sentence1) 39 | paragraph_list = self.split_report_paragraphs(text) 40 | instruction = self.INSTRUCTION3 41 | else: 42 | raise ValueError("Invalid process type") 43 | 44 | for paragraph in tqdm(paragraph_list): 45 | prompt = instruction + "\n" + paragraph 46 | answer = self.llm.predict(prompt) 47 | if answer != "错误句子:无": 48 | if process_type == "clause" and "港澳台" in answer: 49 | continue 50 | answer_list.append([answer[5:]]) 51 | 52 | if process_type == "report": 53 | final_answer_list = [] 54 | for answer in answer_list: 55 | checked_answer = self.check_answer(answer, text) 56 | if checked_answer: 57 | final_answer_list.append(checked_answer) 58 | 59 | answer_list = self.remove_duplicates(final_answer_list) 60 | result.append({"id": os.path.splitext(os.path.basename(document_path))[0], "sents": final_answer_list}) 61 | else: 62 | answer_list = self.remove_duplicates(answer_list) 63 | result.append({"id": os.path.splitext(os.path.basename(document_path))[0], "sents": answer_list}) 64 | return result 65 | 66 | def split_bid_paragraphs(self, text): 67 | paragraphs = text.strip().split('\n') 68 | merged_paragraphs = [] 69 | current_paragraph = [] 70 | if "一、" in text and "二、" in text and "三、" in text and "四、" in text and "五、" in text: 71 | levels = ["一、", "二、", "三、", "四、", "五、", "六、", "七、", "八、", "九、", "十、", "十一、", "十二、"] 72 | else: 73 | levels = [f"{i}." for i in range(1, 16)] 74 | current_level_index = 0 75 | 76 | for paragraph in paragraphs: 77 | # 检查段落是否以数字加句号开头 78 | if paragraph.strip().startswith(levels[current_level_index]): 79 | # 如果当前段落是新的级别,则将之前的段落合并并添加到结果中 80 | if current_paragraph: 81 | merged_paragraphs.append('\n'.join(current_paragraph)) 82 | current_paragraph = [] 83 | current_level_index += 1 84 | 85 | current_paragraph.append(paragraph) 86 | 87 | # 添加最后一个段落 88 | if current_paragraph: 89 | merged_paragraphs.append('\n'.join(current_paragraph)) 90 | 91 | # 把过长的字符串切分 92 | output_list = [] 93 | for string in merged_paragraphs: 94 | if len(string) > 1024: 95 | for i in range(0, len(string), 1024): 96 | output_list.append(string[i:i + 1024]) 97 | else: 98 | output_list.append(string) 99 | return output_list 100 | 101 | def split_clause_paragraphs(self, text): 102 | paragraphs = text.strip().split('\n') 103 | merged_paragraphs = [] 104 | current_paragraph = [] 105 | 106 | for paragraph in paragraphs: 107 | # 检查段落是否以“第”开头并在前10个字符内包含“条” 108 | if "第" in paragraph[:10] and "条" in paragraph[:10]: 109 | # 如果当前段落是新的级别,则将之前的段落合并并添加到结果中 110 | if current_paragraph: 111 | merged_paragraphs.append('\n'.join(current_paragraph)) 112 | current_paragraph = [] 113 | 114 | current_paragraph.append(paragraph) 115 | 116 | # 添加最后一个段落 117 | if current_paragraph: 118 | merged_paragraphs.append('\n'.join(current_paragraph)) 119 | 120 | re_merged_paragraphs = [] 121 | small_paragraph = "" 122 | for paragraph in merged_paragraphs: 123 | if len(small_paragraph) + len(paragraph) + 1 < 512: # +1 for the newline character 124 | if small_paragraph: 125 | small_paragraph += "\n" + paragraph 126 | else: 127 | small_paragraph = paragraph 128 | else: 129 | re_merged_paragraphs.append(small_paragraph) 130 | small_paragraph = paragraph 131 | 132 | if small_paragraph: 133 | re_merged_paragraphs.append(small_paragraph) 134 | 135 | # 把过长的字符串切分 136 | output_list = [] 137 | for string in merged_paragraphs: 138 | if len(string) > 1024: 139 | for i in range(0, len(string), 1024): 140 | output_list.append(string[i:i + 1024]) 141 | else: 142 | output_list.append(string) 143 | return output_list 144 | 145 | def split_report_paragraphs(self,text): 146 | paragraphs = text.strip().split('\n') 147 | 148 | return [line for line in paragraphs if line.strip() != ''] 149 | 150 | def find_invalid_Q(self, text): 151 | # 定义正则表达式,用于匹配中文的逗号、句号和换行符 152 | pattern = r'[,;。\n]' 153 | 154 | # 使用正则表达式拆分字符串 155 | sentences = re.split(pattern, text) 156 | 157 | # 用于存储结果的列表 158 | result = [] 159 | 160 | for sentence in sentences: 161 | # 检查句子中是否包含字母 Q 162 | if 'Q' in sentence: 163 | # 查找 Q 后面的字符 164 | q_index = sentence.index('Q') 165 | if q_index + 1 < len(sentence) and sentence[q_index + 1].isdigit(): 166 | # 检查数字范围是否是 1 到 4 167 | number = int(sentence[q_index + 1]) 168 | if not (1 <= number <= 4): 169 | # 查找句子在原字符串中的位置 170 | start_index = text.find(sentence) 171 | if start_index != -1: 172 | # 查找紧接着的标点符号 173 | end_index = start_index + len(sentence) 174 | if end_index < len(text): 175 | next_char = text[end_index] 176 | result.append([sentence.strip() + next_char]) 177 | 178 | return result 179 | 180 | def check_answer(self, answer, str2): 181 | str1 = answer[0] 182 | # 检查str1是否是str2的子串 183 | if str1 not in str2: 184 | return [] 185 | 186 | # 定义特定标点符号 187 | specific_punctuations = ",。;" 188 | 189 | # 检查str1中是否只有一个特定标点符号 190 | punctuation_count = sum(1 for char in str1 if char in specific_punctuations) 191 | if punctuation_count == 1: 192 | return [str1] 193 | 194 | # 如果没有特定标点符号 195 | if punctuation_count == 0: 196 | # 检查str1在str2中是否后面紧跟着特定标点符号 197 | index = str2.index(str1) 198 | if index + len(str1) < len(str2) and str2[index + len(str1)] in specific_punctuations: 199 | return [str1 + str2[index + len(str1)]] 200 | else: 201 | return [] 202 | 203 | # 如果有大于一个的特定标点符号 204 | if punctuation_count > 1: 205 | # 按照特定标点符号分割str1 206 | substrings = re.split(r'[,。;]', str1) 207 | # 判断哪一个子字符串中有数字 208 | substrings_with_digits = [substring for substring in substrings if any(char.isdigit() for char in substring)] 209 | if len(substrings_with_digits) == 1: 210 | substring_with_digits = substrings_with_digits[0] 211 | index = str1.index(substring_with_digits) 212 | if index + len(substring_with_digits) < len(str1) and str1[index + len(substring_with_digits)] in specific_punctuations: 213 | return [substring_with_digits + str1[index + len(substring_with_digits)]] 214 | else: 215 | return [substring_with_digits] 216 | else: 217 | return [] 218 | 219 | def remove_duplicates(self, answer_list): 220 | """ 221 | 去除包含子列表的列表中的重复子列表。 222 | """ 223 | if len(answer_list) >5: 224 | return [] 225 | unique_answer_list = [] 226 | for sublist in answer_list: 227 | if sublist not in unique_answer_list: 228 | unique_answer_list.append(sublist) 229 | return unique_answer_list 230 | 231 | @staticmethod 232 | def save_as_json_lines(data, output_file): 233 | with open(output_file, 'w', encoding='utf-8') as file: 234 | for item in data: 235 | json.dump(item, file, ensure_ascii=False) 236 | file.write('\n') 237 | 238 | def split_category(document_path_list): 239 | category_1 = [] 240 | category_2 = [] 241 | category_3 = [] 242 | 243 | for document_path in document_path_list: 244 | 245 | text = "" 246 | doc = Document(document_path) 247 | for p in doc.paragraphs: 248 | text = text + "\n" + p.text 249 | 250 | if ("招标" in text[:200] or "采购" in document_path or "招标" in document_path or "公告" in document_path) and "法" not in document_path: 251 | category_1.append(document_path) 252 | elif "条款" in document_path or "条例" in document_path or "办法" in document_path or "中华人民共和国" in document_path: 253 | category_2.append(document_path) 254 | else: 255 | category_3.append(document_path) 256 | 257 | return category_1, category_2, category_3 258 | 259 | def main(args): 260 | # 获取当前工作目录路径 261 | # current_directory = os.getcwd() 262 | # print(f"当前工作目录: {current_directory}") 263 | # model_path = os.path.join(current_directory, "../", "models/qwen2-7b-instruct-finance-maodun") 264 | model_path = args.model_path 265 | folder = args.input_folder 266 | save_path = args.output_file 267 | 268 | document_path_list = [os.path.join(folder, filename) for filename in os.listdir(folder) if filename.endswith('.docx')] 269 | category_1, category_2, category_3 = split_category(document_path_list) 270 | 271 | processor = DocumentProcessor(model_path) 272 | result1 = processor.process_documents(category_1, "bid") 273 | result2 = processor.process_documents(category_2, "clause") 274 | result3 = processor.process_documents(category_3, "report") 275 | 276 | result = result1 + result2 + result3 277 | DocumentProcessor.save_as_json_lines(result, save_path) 278 | print(f"处理完毕!结果保存在{save_path}") 279 | 280 | if __name__ == "__main__": 281 | 282 | parser = argparse.ArgumentParser(description="Process documents and save results.") 283 | parser.add_argument("--model_path", type=str, default="/models/qwen2-7b-instruct-finance-maodun-merged", help="Path to the model") 284 | parser.add_argument("--input_folder", type=str, default="roundb", help="Path to the folder containing documents") 285 | parser.add_argument("--output_file", type=str, default="result.json", help="Path to save the output JSONL file") 286 | args = parser.parse_args() 287 | 288 | main(args) --------------------------------------------------------------------------------