cleanup dataset.map functions
This commit is contained in:
parent
0b62a21dc0
commit
bc5e0f492a
@ -127,8 +127,8 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def tokenize_data(example, tokenizer, max_length):\n",
|
||||
" tokens = {'tokens': tokenizer(example['text'])[:max_length]}\n",
|
||||
" return tokens"
|
||||
" tokens = tokenizer(example['text'])[:max_length]\n",
|
||||
" return {'tokens': tokens}"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -861,8 +861,8 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def numericalize_data(example, vocab):\n",
|
||||
" ids = {'ids': [vocab[token] for token in example['tokens']]}\n",
|
||||
" return ids"
|
||||
" ids = [vocab[token] for token in example['tokens']]\n",
|
||||
" return {'ids': ids}"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -170,8 +170,8 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def numericalize_data(example, vocab):\n",
|
||||
" ids = {'ids': [vocab[token] for token in example['tokens']]}\n",
|
||||
" return ids"
|
||||
" ids = [vocab[token] for token in example['tokens']]\n",
|
||||
" return {'ids': ids}"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user