Tokenization for Natural Language Processing
Tokenize is mean to break down a sentence to server work, for example:I have a car. -> I / have / a/ carTensorflow provide a tokenize tool:Tokenizer, it can easily to use for tokenize input sentence.
Code:
Result:
{'have': 1, 'a': 2, 'i': 3, 'he': 4, 'apple': 5, 'bike': 6, 'pen': 7, 'car': 8}
沒有留言:
張貼留言