RuntimeError: invalid file for list filter


#1

Hello,
When I tried to run the following command in Jupyter( in window 7),
the following error message comes out.

with open(‘C:/KDD_17/hands on tutorials/MeTA_ModErn_Text_Analysis/cranfield/cranfield-config.toml’, ‘w’) as f:
f.write(config)
import metapy
inv_idx = metapy.index.make_inverted_index(‘C:/KDD_17/hands on tutorials/MeTA_ModErn_Text_Analysis/cranfield/cranfield-config.toml’)


RuntimeError Traceback (most recent call last)
in ()
4
5 import metapy
----> 6 inv_idx = metapy.index.make_inverted_index(‘C:/KDD_17/hands on tutorials/MeTA_ModErn_Text_Analysis/cranfield/cranfield-config.toml’)

RuntimeError: invalid file for list filter


Please help me how to fix this error.

Thanks


#2

What is the content of cranfield-config.toml, and from what directory are you running the Python interpreter from?


#3

The content of cranfield-config.toml is following.

prefix = "." # tells MeTA where to search for datasets

dataset = "cranfield" # a subfolder under the prefix directory
corpus = "tutorial.toml" # a configuration file for the corpus specifying its format & additional args

index = "cranfield-idx" # subfolder of the current working directory to place index files

query-judgements = "cranfield/cranfield-qrels.txt" # file containing the relevance judgments for this dataset

stop-words = "lemur-stopwords.txt"

[[analyzers]]
method = "ngram-word"
ngram = 1
filter = "default-unigram-chain"

I am running the Python from the following directory.
pwd
’C:\Users\taeheej’


#4

Do you have the file lemur-stopwords.txt in that directory?


#5

Yes, the file lemur-stopwords.txt is located in that directory.


#6

Same question. I met the same problem when I was using django.