Skip to content

Commit

Permalink
relative path fix
Browse files Browse the repository at this point in the history
  • Loading branch information
R1j1t committed May 14, 2020
1 parent c1724b0 commit b833c37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion contextualSpellCheck/contextualSpellCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import torch
import editdistance
import datetime
import os

from spacy.tokens import Doc, Token, Span
from spacy.vocab import Vocab
Expand All @@ -15,7 +16,10 @@ class ContextualSpellCheck(object):

name = "contextual spellchecker"

def __init__(self, vocab_path="./data/vocab.txt", debug=False):
def __init__(self, vocab_path="", debug=False):
if vocab_path == "":
currentPath = os.path.dirname(__file__)
vocab_path = os.path.join(currentPath, 'data/vocab.txt')
# self.nlp = spacy.load(
# "en_core_web_sm", disable=["tagger", "parser"]
# ) # using default tokeniser with NER
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="contextualSpellCheck",
version="0.0.3",
version="0.0.4",
author="R1j1t",
author_email="r1j1t@protonmail.com",
description="Contextual spell correction using BERT (bidirectional representations)",
Expand Down

0 comments on commit b833c37

Please sign in to comment.