Python Untokenize a sentence

后端 未结 10 1098
名媛妹妹
名媛妹妹 2021-02-01 15:46

There are so many guides on how to tokenize a sentence, but i didn\'t find any on how to do the opposite.

 import nltk
 words = nltk.word_tokenize(\"I\'ve found          


        
10条回答
  •  灰色年华
    2021-02-01 16:09

    Use the join function:

    You could just do a ' '.join(words) to get back the original string.

提交回复
热议问题