用主題找出詐騙者
在這個練習中,你要把主題模型的結果連回原始資料。你已經知道需要標記所有與主題 3相關的內容。你會發現,這其實沒有那麼直接。你會拿到函式 get_topic_details(),它接受 ldamodel 和 corpus 作為引數,並擷取每一行文字的主題細節。利用這個函式,你可以把結果接回原始資料。若你想更深入了解如何處理模型輸出(超出本課程範圍),非常推薦閱讀這篇文章:https://www.machinelearningplus.com/nlp/topic-modeling-gensim-python/。
你可以使用的變數包括 dictionary、corpus、清理後的文字資料 text_clean,以及你的模型結果 ldamodel。get_topic_details() 也已定義完成。
本練習屬於課程
Fraud Detection in Python
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Run get_topic_details function and check the results
print(get_topic_details(____, ____))