shayneobrien / text-cluster Goto Github PK
View Code? Open in Web Editor NEWOffline and online (i.e., real-time) annotated clustering methods for text data.
Offline and online (i.e., real-time) annotated clustering methods for text data.
streamer = StreamData(filename='../data/talk_radio.csv', chunk=500, use_column='sentences')
init_text = streamer._init_data(10)
online = OnlineCluster(text=list(init_text.processed), method='kmeans', n_clusters=10)
num_batches = 25
for _ in tqdm(range(num_batches)):
new_text = streamer()
labels = online.predict(list(new_text.processed))
I run this code but I got the below error
StopIteration Traceback (most recent call last)
<ipython-input-91-064fb5ae967b> in <module>
22
23 # Get new batch
---> 24 new_text = streamer()
25
26 # Predict
~/Desktop/text-cluster-master/src/modules.py in __call__(self)
25 def __call__(self):
26 """ Get a batch from the generator """
---> 27 return self._process(self.stream())
28
29 def stream(self):
~/Desktop/text-cluster-master/src/modules.py in stream(self)
29 def stream(self):
30 """ Iterate generator """
---> 31 return next(self.generator)
32
33 def _init_data(self, num_chunks):
~/.local/lib/python3.8/site-packages/pandas/io/parsers.py in __next__(self)
1027 def __next__(self):
1028 try:
-> 1029 return self.get_chunk()
1030 except StopIteration:
1031 self.close()
~/.local/lib/python3.8/site-packages/pandas/io/parsers.py in get_chunk(self, size)
1077 raise StopIteration
1078 size = min(size, self.nrows - self._currow)
-> 1079 return self.read(nrows=size)
1080
1081 def __enter__(self):
~/.local/lib/python3.8/site-packages/pandas/io/parsers.py in read(self, nrows)
1050 def read(self, nrows=None):
1051 nrows = validate_integer("nrows", nrows)
-> 1052 index, columns, col_dict = self._engine.read(nrows)
1053
1054 if index is None:
~/.local/lib/python3.8/site-packages/pandas/io/parsers.py in read(self, nrows)
2054 def read(self, nrows=None):
2055 try:
-> 2056 data = self._reader.read(nrows)
2057 except StopIteration:
2058 if self._first_chunk:
pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader.read()
pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._read_low_memory()
StopIteration:
Please help me !!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.