代码拉取完成,页面将自动刷新
同步操作将从 peiss/ant-learn-python-100P 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
"""
Python实现小型的论文查重系统
"""
python_article = "./datas/articles/Python-计算机编程语言.txt"
flask_article = "./datas/articles/Flask-PythonWeb应用框架.txt"
java_article = "./datas/articles/Java-计算编程语言.txt"
shortvideo_article = "./datas/articles/短视频-简介.txt"
import jieba.analyse
def get_keyword_from_article(fname):
with open(fname) as fin:
content = fin.read()
return jieba.analyse.extract_tags(content, 50)
def compute_sim(wordsa, wordsb):
jiaoji = set(wordsa).intersection(set(wordsb))
bingji = set(wordsa).union(set(wordsb))
return round(len(jiaoji) * 100 / len(bingji), 2)
python_words = get_keyword_from_article(python_article)
flask_words = get_keyword_from_article(flask_article)
java_words = get_keyword_from_article(java_article)
shortvideo_words = get_keyword_from_article(shortvideo_article)
print("python vs python", compute_sim(python_words, python_words))
print("python vs flask", compute_sim(python_words, flask_words))
print("python vs java", compute_sim(python_words, java_words))
print("python vs shortvideo", compute_sim(python_words, shortvideo_words))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。