graykode / graykode/nlp-tutorial
About make_batch of NNLM
- Dominant language
- Jupyter Notebook
- Stars
- 14.9k
- Forks
- 3.9k
- PR merge metrics
- No merged PRs in 30d
Description
```python
input = [word_dict[n] for n in word[:-1]] # create (1~n-1) as input
target = [word_dict[word[-1]]]
```
it constraints the length of input and n_step. I think the following example is even better
```python
for i in range(len(words) - window_size + 1):`
` x_train.append(words[i: i + window_size - 1])`
`y_train.append(words[i + window_size - 1])
```
Contributor guide
Research direction
Start by locating the make_batch entry point in the NNLM tutorial and read how input, target, word, n_step, and window_size are currently used. Compare its generated training pairs with the proposed sliding-window example; done means the batching behavior supports the intended window length without constraining input and n_step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100