Skip to content

Commit

Permalink
Merge pull request #30 from apmoore1/master
Browse files Browse the repository at this point in the history
fixes #29. Thanks for this PR
  • Loading branch information
nreimers authored Sep 19, 2018
2 parents 10d8bb2 + a87d96d commit b709f58
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions util/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ def createDict(filename, tokenPos, vocab):
vocab[wordLower] = True
vocab[wordNormalized] = True

for dataset in datasetFiles:
dataColumnsIdx = {y: x for x, y in dataset['cols'].items()}
for dataset_name, dataset in datasetFiles.items():
dataColumnsIdx = {y: x for x, y in dataset['columns'].items()}
tokenIdx = dataColumnsIdx['tokens']
datasetPath = 'data/%s/' % dataset['name']
datasetPath = 'data/%s/' % dataset_name

for dataset in ['train.txt', 'dev.txt', 'test.txt']:
createDict(datasetPath + dataset, tokenIdx, neededVocab)
for dataset_file_name in ['train.txt', 'dev.txt', 'test.txt']:
createDict(datasetPath + dataset_file_name, tokenIdx, neededVocab)

# :: Read in word embeddings ::
logging.info("Read file: %s" % embeddingsPath)
Expand Down

0 comments on commit b709f58

Please sign in to comment.