Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit e9a6418

Browse files
authored
fixed paths to dropdown.js and style dir
1 parent a86e9c5 commit e9a6418

File tree

1 file changed

+4
-3
lines changed
  • solutions/absa_solution

1 file changed

+4
-3
lines changed

solutions/absa_solution/ui.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@
3535
from bokeh.core.properties import value
3636
from tornado.web import StaticFileHandler
3737

38+
from nlp_architect import LIBRARY_PATH
3839
from nlp_architect.models.absa import LEXICONS_OUT
3940
from nlp_architect.models.absa.train.acquire_terms import AcquireTerms
4041
from nlp_architect.models.absa.train.train import TrainSentiment
4142
from nlp_architect.models.absa.inference.data_types import SentimentDoc, SentimentSentence
4243
from sentiment_solution import SENTIMENT_OUT, SentimentSolution
4344

45+
SOLUTION_DIR = join(LIBRARY_PATH, 'solutions/absa_solution/')
4446
POLARITIES = ("POS", "NEG")
4547

46-
4748
# pylint: disable=global-variable-undefined
4849
def serve_absa_ui() -> None:
4950
"""Main function for serving UI application.
@@ -61,7 +62,7 @@ def _doc_modifier(doc: Document) -> None:
6162
(
6263
"/style/(.*)",
6364
StaticFileHandler,
64-
{"path": os.path.normpath(os.path.dirname(__file__) + "/style")},
65+
{"path": os.path.normpath(join(SOLUTION_DIR, "/style"))},
6566
)
6667
],
6768
)
@@ -211,7 +212,7 @@ def data_column(title):
211212
train_src = new_col_data_src()
212213
infer_src = new_col_data_src()
213214

214-
with open(join(dirname(__file__), "dropdown.js")) as f:
215+
with open(join(SOLUTION_DIR, "dropdown.js")) as f:
215216
args = dict(
216217
clicked=lexicons_dropdown,
217218
asp_filter=asp_filter_src,

0 commit comments

Comments
 (0)