semanticize / semanticizer

Entity Linking for the masses
http://semanticize.uva.nl/
GNU General Public License v3.0
56 stars 15 forks source link

Directory $TMPDIR/$LANGUAGE not found #13

Closed pieterb closed 11 years ago

pieterb commented 11 years ago
Traceback (most recent call last):
  File "main.py", line 100, in <module>
    feature_conf)
  File "main.py", line 40, in start_server
    pipeline = procpipeline.build(langcodes, feature_config)
  File "/Users/pieterb/Documents/semanticize/semanticizer/procpipeline.py", line 41, in build
    _load_features(pipeline, langcodes, feature_config)
  File "/Users/pieterb/Documents/semanticize/semanticizer/procpipeline.py", line 84, in _load_features
    feature_config["picklepath"])))
  File "/Users/pieterb/Documents/semanticize/semanticizer/processors/external.py", line 39, in __init__
    + 'article_cache.db')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shelve.py", line 239, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shelve.py", line 223, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/anydbm.py", line 85, in open
    return mod.open(file, flag, mode)
dbm.error: (2, 'No such file or directory')

Cause

In commit 97340c5df84f67f196b6429273299a00d7993960, on line 37-38 of processors/external.py:

  pickle_root = pickledir + '/' + langcode + '/'
  self.article_cache[langcode] = shelve.open(pickle_root
    + 'article_cache.db')

This fails if the pickle_root directory doesn’t exist.

Workaround

Create this directory before running the semanticizer:

mkdir /tmp/nl/

Solution

In the code, check if the directory exists, and create it if not.

dodijk commented 11 years ago

Was fixed in e18899e74b3374a71b67c764006ac285bfd41d9c of one day before your issue...