我需要使用文本挖掘/ NLP /信息檢索從文本文檔中提取源和目標項? 例如: 1. i am travelling from New York to London.
2. i am heading towards playground from home.
3. i will be going to Sweden from Boston.
4. i was flying from Schoo
我有以下代碼: ID= # type is <class 'str'>
dictionary={} #Dictionary
with open('result.PRED', 'a') as fileOut:
for item in dictionary.keys():
print(Question_ID,item,dictionary[item],sep='\t',