代码拉取完成,页面将自动刷新
# _*_ 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!如果你想结束程序,请输入“再见”。")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。