如何使用具有其他功能的 NLP

数据挖掘 分类 nlp
2022-02-22 22:06:17

我的数据集看起来像这样

Sport_Type       City         Report_Text                                                 Labels
Ball             Toronto      Messi has been announced the best soccer player...          Soccer
Swimming         London       Todays new records in Butterfly Stroke & Backstroke...      Butterfly Swimming, Backstroke Swimming, Front Crawl
Ball             Chicago      Tennis and basketball along with football has...            Tennis, basketball, Soccer
Fighting         Sydney       Todays matches include boxing, judo, and...                 Boxing, Judo, Karate
Horse            Melbourne    Melbourne Cup is the race that stops the nation...          Horse Racing

我可以建立多标签模型来识别每个Report_Text字段中的标签。

但是有没有一种方法可以让我考虑Sport_TypeCity在我的模型中使用它,因为它有助于改善结果。

如何NLP 多标签模型Sport_Type中使用其他功能?City

1个回答

Sport_Type并且City特征是分类特征,因此需要将它们编码为数字格式(例如,单热编码或特征散列)。这些数字特征可以添加到任何机器学习模型中,包括长短期记忆 (LSTM)。