Comments (1)
def _fill_buffer(self, size):
if not self._buffer:
for line in self._file:
label, sentence = line.split("\t")
label = int(label.strip())
sequence = [self._vocab.token_to_id(t) for t in sentence.strip().split()]
self._buffer.append((label, sequence))
if len(self._buffer) >= size:
break
self._buffer.sort(key=lambda x: len(x[1]))
self._buffer_iter = iter(self._buffer)
Using self._buffer to stop filling, I think, is wrong. self._buffer never change in the next().
from cnn-text-classification-pytorch.
Related Issues (19)
- hi, errors when call cuda() on this model HOT 1
- Issue with the prediction function HOT 3
- Pre-trained word embeddings HOT 4
- l2 norm HOT 3
- prediction error HOT 2
- Issue with running code on SST Dataset HOT 1
- Data load error in Python2
- Embedding Static HOT 2
- εΊειΏεΊ¦ HOT 1
- why the acc is so high?
- How to make the embedding changeable in backpropagation HOT 1
- RuntimeError: set_storage_offset is not allowed on Tensor created from .data or .detach() HOT 1
- feature.data.t_(), target.data.sub_(1) HOT 2
- Preprocessing issue in mydatasets.py HOT 1
- Performance on MR dataset HOT 2
- Output raw input sentences HOT 1
- I got some mistakes
- 'Field' object has no attribute 'vocab'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cnn-text-classification-pytorch.