【发布时间】:2021-03-05 06:09:18
【问题描述】:
我正在尝试制作一个项目,其中根据特定地区的天气状况生成农业建议。我现在有一个示例数据集,如下所示。
| state | district | month | rainfall | max_temp | min_temp | max_rh | min_rh | wind_speed | advice |
|---|---|---|---|---|---|---|---|---|---|
| Orissa | Kendrapada | february | 0.0 | 34.6 | 19.4 | 88.2 | 29.6 | 12.0 | chances of foot rot disease in paddy crop; apply urea at 3 weeks after transplanting at active tillering stage for paddy;...... |
| Jharkhand | Saraikela Kharsawan | february | 0 | 35.2 | 16.6 | 29.4 | 11.2 | 3.6 | provide straw mulch and go for intercultural operations to avoid moisture losses from soil; chance of leaf blight disease in potato crop; ....... |
我想使用此数据集根据天气状况为农民提供建议。我已经标记了建议栏,这是预览。 Tokenized advice image
对其进行标记的代码:
tokenizer= Tokenizer()
token_advice=[]
for i in df['advice']:
tokenizer.fit_on_texts(i)
sq = tokenizer.texts_to_sequences(i)
pda=pad_sequences(sq,padding='pre', truncating='post', maxlen=30)
token_advice.append(pda)
df['token_advice']=token_advice
现在,我想使用数据集训练模型并能够生成建议。我是机器学习的新手。我该怎么做?
【问题讨论】: