Skip to content

Commit

Permalink
Make src an explicit module (solves relative import issues)
Browse files Browse the repository at this point in the history
  • Loading branch information
Profir-Petru Partachi committed Jan 21, 2020
1 parent 35e0b5c commit 879ca38
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
3 changes: 3 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# POSIT
[![DOI](https://zenodo.org/badge/233908281.svg)](https://zenodo.org/badge/latestdoi/233908281)


This a project to simultaneously provide language ID tags and Part-Of-Speech
or compiler tags (which are taken from CLANG compilations of C and C++ code).

Expand Down
6 changes: 3 additions & 3 deletions src/RPC_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ def main():

from nltk import casual_tokenize

from .preprocessor.preprocess import CODE_TOKENISATION_REGEX
from .tagger.config import Configuration
from .evaluate import restore_model
from src.preprocessor.preprocess import CODE_TOKENISATION_REGEX
from src.tagger.config import Configuration
from src.evaluate import restore_model
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler

Expand Down
8 changes: 4 additions & 4 deletions src/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from nltk import casual_tokenize

from .preprocessor.preprocess import CODE_TOKENISATION_REGEX
from .tagger.config import Configuration
from .tagger.data_utils import CorpusIterator
from .tagger.model import CodePoSModel
from src.preprocessor.preprocess import CODE_TOKENISATION_REGEX
from src.tagger.config import Configuration
from src.tagger.data_utils import CorpusIterator
from src.tagger.model import CodePoSModel


def interactive_shell(model, casual=False):
Expand Down
6 changes: 3 additions & 3 deletions src/process.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys

from .preprocessor.preprocess import tokenise_SO, tokenise_lkml
from .tagger.config import Configuration
from .tagger.model import CodePoSModel
from src.preprocessor.preprocess import tokenise_SO, tokenise_lkml
from src.tagger.config import Configuration
from src.tagger.model import CodePoSModel


def process_data(model, target_data, stackoverflow=False):
Expand Down
6 changes: 3 additions & 3 deletions src/process_pairs.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import sys

from .preprocessor.preprocess import tokenize_SO_row
from .tagger.config import Configuration
from .tagger.model import CodePoSModel
from src.preprocessor.preprocess import tokenize_SO_row
from src.tagger.config import Configuration
from src.tagger.model import CodePoSModel


def process_one_rev(model, target_data, rev, post_id):
Expand Down
2 changes: 1 addition & 1 deletion src/tagger/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def load(self):

# general config
with_l_id = True
project = "SO_Freq"
project = "SO_n_Lucid"
project += '_Id' if with_l_id else ''
# project += '5'
# embeddings
Expand Down
6 changes: 3 additions & 3 deletions src/train.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
import os

from .tagger.config import Configuration
from .tagger.data_utils import CorpusIterator
from .tagger.model import CodePoSModel
from src.tagger.config import Configuration
from src.tagger.data_utils import CorpusIterator
from src.tagger.model import CodePoSModel


def main():
Expand Down

0 comments on commit 879ca38

Please sign in to comment.