Annotation web Server issues

Using the well-known Kaggle Dataset started prodigy but webserver stated the task failed

python -m prodigy textcat.manual stress_tection /Users/udaykamath/Downloads/TwitterDataset/training.1600000.processed.noemoticon.csv --label 0,2,4
Using 3 label(s): 0, 2, 4

:sparkles: Starting the web server at http://localhost:8080 ...

Open the app in your browser and start annotating!

Task exception was never retrieved
future: <Task finished coro=<RequestResponseCycle.run_asgi() done, defined at /Users/udaykamath/anaconda3/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py:383> exception=UnicodeDecodeError('utf-8', b'unny here but I'm at work "\n"0","1980864907","Sun May 31 07:52:04 PDT 2009","NO_QUERY","ShannenLouYoung","gotta goo..... internet not working very well... byee x"\n"0","1980865622","Sun May 31 07:52:11 PDT 2009",
Traceback (most recent call last):
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py", line 388, in run_asgi
self.logger.error(msg, exc_info=exc)
File "/Users/udaykamath/anaconda3/lib/python3.6/logging/init.py", line 1337, in error
self._log(ERROR, msg, args, **kwargs)
File "/Users/udaykamath/anaconda3/lib/python3.6/logging/init.py", line 1444, in _log
self.handle(record)
File "/Users/udaykamath/anaconda3/lib/python3.6/logging/init.py", line 1453, in handle
if (not self.disabled) and self.filter(record):
File "/Users/udaykamath/anaconda3/lib/python3.6/logging/init.py", line 720, in filter
result = f.filter(record)
File "cython_src/prodigy/util.pyx", line 120, in prodigy.util.ServerErrorFilter.filter
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/Users/udaykamath/.local/lib/python3.6/site-packages/fastapi/applications.py", line 142, in call
await super().call(scope, receive, send) # pragma: no cover
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/applications.py", line 134, in call
await self.error_middleware(scope, receive, send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/middleware/errors.py", line 178, in call
raise exc from None
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/middleware/errors.py", line 156, in call
await self.app(scope, receive, _send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/middleware/cors.py", line 84, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/middleware/cors.py", line 140, in simple_response
await self.app(scope, receive, send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/exceptions.py", line 73, in call
raise exc from None
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/exceptions.py", line 62, in call
await self.app(scope, receive, sender)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/routing.py", line 590, in call
await route(scope, receive, send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/routing.py", line 208, in call
await self.app(scope, receive, send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/Users/udaykamath/.local/lib/python3.6/site-packages/fastapi/routing.py", line 129, in app
raw_response = await run_in_threadpool(dependant.call, **values)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/concurrency.py", line 25, in run_in_threadpool
return await loop.run_in_executor(None, func, *args)
File "/Users/udaykamath/anaconda3/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/udaykamath/.local/lib/python3.6/site-packages/prodigy/app.py", line 413, in get_session_questions
return _shared_get_questions(req.session_id, excludes=req.excludes)
File "/Users/udaykamath/.local/lib/python3.6/site-packages/prodigy/app.py", line 384, in _shared_get_questions
tasks = controller.get_questions(session_id=session_id, excludes=excludes)
File "cython_src/prodigy/core.pyx", line 138, in prodigy.core.Controller.get_questions
File "cython_src/prodigy/components/feeds.pyx", line 68, in prodigy.components.feeds.SharedFeed.get_questions
File "cython_src/prodigy/components/feeds.pyx", line 73, in prodigy.components.feeds.SharedFeed.get_next_batch
File "cython_src/prodigy/components/feeds.pyx", line 153, in prodigy.components.feeds.SessionFeed.get_session_stream
File "cython_src/prodigy/components/feeds.pyx", line 135, in prodigy.components.feeds.SessionFeed.validate_stream
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/toolz/itertoolz.py", line 368, in first
return next(iter(seq))
File "cython_src/prodigy/components/preprocess.pyx", line 237, in add_label_options
File "cython_src/prodigy/components/filters.pyx", line 37, in filter_duplicates
File "cython_src/prodigy/components/filters.pyx", line 13, in filter_empty
File "cython_src/prodigy/components/loaders.pyx", line 19, in _rehash_stream
File "cython_src/prodigy/components/loaders.pyx", line 163, in CSV
File "/Users/udaykamath/anaconda3/lib/python3.6/csv.py", line 112, in next
row = next(self.reader)
File "/Users/udaykamath/anaconda3/lib/python3.6/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 7970-7971: invalid continuation byte

Hi! The error seems to occur when Python's built-in CSV reader tries to open that file. How is that CSV file formatted and what's the file encoding? You might just have to change the encoding, see here:

I used pandas, removed all the characters which are not alphanumeric, kept only 2 columns label and the cleaned text. Now I get
^CUdays-MacBook-Pro:prodigy udaykamath$ python -m prodigy textcat.manual stresdetection /Users/udaykamath/Downloads/TwitterDataset/processedtweets.csv --label 0,2,4

Using 3 label(s): 0, 2, 4

:sparkles: Starting the web server at http://localhost:8080 ...

Open the app in your browser and start annotating!

✘ Error while validating stream: no first example

This likely means that your stream is empty.

Ok I changed the column names to be {label, text} and now I get python attribute error

Task exception was never retrieved
future: <Task finished coro=<RequestResponseCycle.run_asgi() done, defined at /Users/udaykamath/anaconda3/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py:383> exception=AttributeError("module 'murmurhash' has no attribute 'hash'",)>
Traceback (most recent call last):
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py", line 388, in run_asgi
self.logger.error(msg, exc_info=exc)
File "/Users/udaykamath/anaconda3/lib/python3.6/logging/init.py", line 1337, in error
self._log(ERROR, msg, args, **kwargs)
File "/Users/udaykamath/anaconda3/lib/python3.6/logging/init.py", line 1444, in _log
self.handle(record)
File "/Users/udaykamath/anaconda3/lib/python3.6/logging/init.py", line 1453, in handle
if (not self.disabled) and self.filter(record):
File "/Users/udaykamath/anaconda3/lib/python3.6/logging/init.py", line 720, in filter
result = f.filter(record)
File "cython_src/prodigy/util.pyx", line 120, in prodigy.util.ServerErrorFilter.filter
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in call
return await self.app(scope, receive, send)
File "/Users/udaykamath/.local/lib/python3.6/site-packages/fastapi/applications.py", line 142, in call
await super().call(scope, receive, send) # pragma: no cover
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/applications.py", line 134, in call
await self.error_middleware(scope, receive, send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/middleware/errors.py", line 178, in call
raise exc from None
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/middleware/errors.py", line 156, in call
await self.app(scope, receive, _send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/middleware/cors.py", line 84, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/middleware/cors.py", line 140, in simple_response
await self.app(scope, receive, send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/exceptions.py", line 73, in call
raise exc from None
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/exceptions.py", line 62, in call
await self.app(scope, receive, sender)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/routing.py", line 590, in call
await route(scope, receive, send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/routing.py", line 208, in call
await self.app(scope, receive, send)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/Users/udaykamath/.local/lib/python3.6/site-packages/fastapi/routing.py", line 129, in app
raw_response = await run_in_threadpool(dependant.call, **values)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/starlette/concurrency.py", line 25, in run_in_threadpool
return await loop.run_in_executor(None, func, *args)
File "/Users/udaykamath/anaconda3/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/udaykamath/.local/lib/python3.6/site-packages/prodigy/app.py", line 413, in get_session_questions
return _shared_get_questions(req.session_id, excludes=req.excludes)
File "/Users/udaykamath/.local/lib/python3.6/site-packages/prodigy/app.py", line 384, in _shared_get_questions
tasks = controller.get_questions(session_id=session_id, excludes=excludes)
File "cython_src/prodigy/core.pyx", line 138, in prodigy.core.Controller.get_questions
File "cython_src/prodigy/components/feeds.pyx", line 68, in prodigy.components.feeds.SharedFeed.get_questions
File "cython_src/prodigy/components/feeds.pyx", line 73, in prodigy.components.feeds.SharedFeed.get_next_batch
File "cython_src/prodigy/components/feeds.pyx", line 153, in prodigy.components.feeds.SessionFeed.get_session_stream
File "cython_src/prodigy/components/feeds.pyx", line 135, in prodigy.components.feeds.SessionFeed.validate_stream
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/toolz/itertoolz.py", line 368, in first
return next(iter(seq))
File "cython_src/prodigy/components/preprocess.pyx", line 237, in add_label_options
File "cython_src/prodigy/components/filters.pyx", line 37, in filter_duplicates
File "cython_src/prodigy/components/filters.pyx", line 13, in filter_empty
File "cython_src/prodigy/components/loaders.pyx", line 20, in _rehash_stream
File "cython_src/prodigy/util.pyx", line 264, in prodigy.util.set_hashes
File "cython_src/prodigy/util.pyx", line 294, in prodigy.util.get_hash
AttributeError: module 'murmurhash' has no attribute 'hash'

Try upgrading murmurhash! For some reason, it seems like you ended up with an old version pre-installed in your environment (probably because it's a conda environment and maybe had the Anaconda distribution preinstalled?).

Finally. Updating Murmurhash, fixed it. Thanks

1 Like