snorkel-team / snorkel

A system for quickly generating training data with weak supervision
https://snorkel.org
Apache License 2.0
5.81k stars 857 forks source link

No Module named tika #643

Closed ArghyaPal closed 7 years ago

ArghyaPal commented 7 years ago

Hi,

Thank you, for sharing such a good and self-declarative notebook...! I have got an error I am appending below:

`

ImportError Traceback (most recent call last)

in () ----> 1 from snorkel.parser import XMLMultiDocPreprocessor 2 3 # The following line is for testing only. Feel free to ignore it. 4 file_path = 'data/CDR.BioC.small.xml' if 'CI' in os.environ else 'data/CDR.BioC.xml' 5 ` ` /home/arghya/snorkel/snorkel/parser/__init__.py in () 1 from .corenlp import * 2 from .corpus_parser import * ----> 3 from .doc_preprocessors import * 4 from .parser import * ` ` /home/arghya/snorkel/snorkel/parser/doc_preprocessors.py in () 139 140 --> 141 class TikaPreprocessor(DocPreprocessor): 142 """ 143 This preprocessor use `Apache Tika `_ parser to ` ` /home/arghya/snorkel/snorkel/parser/doc_preprocessors.py in TikaPreprocessor() 158 """ 159 # Tika is conditionally imported here --> 160 import tika 161 # automatically downloads tika jar and starts a JVM processif no REST API 162 # is configured in ENV ` **ImportError: No module named tika** I am very new to python. Please help me.. Regards, Arghya
ajratner commented 7 years ago

Hi @ArghyaPal ,

I'm assuming this means you haven't installed all the python dependencies yet, in particular tika. Please see the installation instructions in the README here!

-Alex

ArghyaPal commented 7 years ago

Hi Alex, Thank you for your quick reply. Yes, now it's working fine. But, I am getting another issue, when I was trying the block :

from snorkel.parser import CorpusParser from utils import TaggerOneTagger tagger_one = TaggerOneTagger() corpus_parser = CorpusParser(fn=tagger_one.tag) corpus_parser.apply(list(doc_preprocessor))

of CDR_Tutorial_1

The error is: TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'

Thank you again, Regards, Arghya

ajratner commented 7 years ago

Hm, I'm unsure of what this error is... we run this tutorial through automated tests and we're not getting any errors here. Could you provide any other details on what's going wrong?

ArghyaPal commented 7 years ago

Hi, it's my installation fault. Sorry for this. Thank you for your help and quick response