from newspaper import Article from chinese_keybert import Chinese_Extractor kw_extractor = Chinese_Extractor() url='https://www.decorations.com.tw/' #url = 'https://www.decorations.com.tw/' #url='https://dctdesign.tw/taipei-house-design-top10/' #url='https://tw.stock.yahoo.com/news/ccs-insight%E9%A0%90%E6%B8%ACaigc%E8%A2%AB%E9%81%8E%E5%BA%A6%E7%82%92%E4%BD%9C-%E6%98%8E%E5%B9%B4%E5%B0%87-%E9%99%8D%E6%BA%AB-003743296.html' #url='https://www.flexclip.com/tw/create/artificial-intelligence-video.html' article = Article(url) article.download() article.parse() txt=article.text print(txt) text=[txt] result = kw_extractor.generate_keywords(text,top_k=40,rank_methods="mmr",diversity=0.6) print(result)