1 Star 0 Fork 0

monash_li/demo-web-search-llm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.py 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
monash_li 提交于 2年前 . 更新api文件
# _*_ coding: utf-8 _*_
# Licensed under the Apache License, Version 2.0 (the "License")
# main function
# Author: MiqroEra Shibo
from chat_func import chat_with_user
from chat_func import score_and_sort_entities
from chat_func import summarize_web_pages
from chat_func import ner_user_input
from chat_func import bing_search_entities
# 编写主程序
if __name__ == "__main__":
print("欢迎使用我的demo!请在下面输入一些内容。")
user_input = input("你:")
reply = chat_with_user(user_input)
print("AI:" + reply)
entities = ner_user_input(user_input)
print("实体识别结果:")
for entity in entities:
print(entity)
sorted_entities = score_and_sort_entities(user_input, entities)
print("权重打分和排序结果:")
for entity, score in sorted_entities:
print(entity, score)
web_urls = bing_search_entities(sorted_entities)
print("必应搜索结果:")
for web_url in web_urls:
print(web_url)
summaries = summarize_web_pages(web_urls)
print("网页摘要结果:")
for summary in summaries:
print(summary)
print("感谢你使用我的demo!如果你想结束程序,请输入“再见”。")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/monash_li/demo-web-search-llm.git
git@gitee.com:monash_li/demo-web-search-llm.git
monash_li
demo-web-search-llm
demo-web-search-llm
master

搜索帮助