Skip to content

Commit

Permalink
corrects pypi url; code clean-up; increment version
Browse files Browse the repository at this point in the history
  • Loading branch information
kodymoodley committed Dec 11, 2023
1 parent e54bbd1 commit c0ab0f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'
environment:
name: pypi
url: https://pypi.org/p/orangestorynavigator
url: https://pypi.org/p/storynavigator
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
Expand All @@ -53,7 +53,7 @@ jobs:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
environment:
name: testpypi
url: https://test.pypi.org/p/orangestorynavigator
url: https://test.pypi.org/p/storynavigator
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
Expand Down
17 changes: 1 addition & 16 deletions orangecontrib/storynavigation/widgets/OWSNActionAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ class Outputs:

# original text (not tagged)
original_text = ""
word_prominence_scores = {}
sli = None

# list of colour values for the background highlight for each entity type
Expand Down Expand Up @@ -569,8 +568,6 @@ def set_selection(self) -> None:

def selection_changed(self) -> None:
"""Function is called every time the selection changes"""
self.agent_prominence_score_min = 0.0
self.actiontagger.word_prominence_scores = {}
self.actiontagger.noun_action_dict = {}
self.actiontagger.num_occurences_as_subject = {}
self.actiontagger.num_occurences = {}
Expand All @@ -584,19 +581,7 @@ def selection_changed(self) -> None:
self.show_docs()
self.commit.deferred()

def prominence_metric_change(self):
self.agent_prominence_score_min = 0.0
self.actiontagger.word_prominence_scores = {}
self.show_docs(slider_engaged=False)
self.commit.deferred()

def slider_callback(self):
if self.agent_prominence_score_min > self.agent_prominence_score_max:
self.agent_prominence_score_min = self.agent_prominence_score_max
self.show_docs(slider_engaged=True)
self.commit.deferred()

def show_docs(self, slider_engaged=False):
def show_docs(self):
if not hasattr(self, "actiontagger"):
self.actiontagger = ActionTagger(constants.NL_SPACY_MODEL)

Expand Down
27 changes: 8 additions & 19 deletions orangecontrib/storynavigation/widgets/OWSNActorAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def show_docs(self, slider_engaged=False):
self.nouns,
self.subjs,
self.agent_prominence_metric,
self.agent_prominence_score_min,
self.agent_prominence_score_min
)
self.Outputs.metrics_freq_table.send(
table_from_frame(
Expand Down Expand Up @@ -720,17 +720,6 @@ def show_docs(self, slider_engaged=False):
base = QUrl.fromLocalFile(__file__)
self.doc_webview.setHtml(HTML.format(html), base)

def as_list(self, dw):
res = []
for item in dw:
if type(item) == str and item != "N/A":
words = item.split(" | ")
if len(words) > 0:
for word in words:
res.append(word.lower().strip())

return list(set(res))

def __mark_text(self, text):
search_keyword = self.regexp_filter.strip("|")
if not search_keyword:
Expand Down Expand Up @@ -877,10 +866,10 @@ def migrate_context(cls, context, version):
delattr(context, "class_vars")


# if __name__ == "__main__":
# from orangewidget.utils.widgetpreview import WidgetPreview
# from orangecontrib.text.preprocess import BASE_TOKENIZER
# corpus_ = Corpus.from_file("book-excerpts")
# corpus_ = corpus_[:3]
# corpus_ = BASE_TOKENIZER(corpus_)
# WidgetPreview(OWSNActorAnalysis).run(corpus_)
if __name__ == "__main__":
from orangewidget.utils.widgetpreview import WidgetPreview
from orangecontrib.text.preprocess import BASE_TOKENIZER
corpus_ = Corpus.from_file("book-excerpts")
corpus_ = corpus_[:3]
corpus_ = BASE_TOKENIZER(corpus_)
WidgetPreview(OWSNActorAnalysis).run(corpus_)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ project_urls =
Bug Tracker = https://github.com/navigating-stories/orange-story-navigator/issues
url = https://github.com/navigating-stories/orange-story-navigator
# release version
version = 0.0.8
version = 0.0.9

[options]
packages = find:
Expand Down

0 comments on commit c0ab0f8

Please sign in to comment.