Skip to content

Commit

Permalink
add to lowercase to user_hashtag_network processor
Browse files Browse the repository at this point in the history
fixes #347
  • Loading branch information
dale-wahl committed Aug 29, 2023
1 parent 8c4fcec commit 8c83df7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion processors/networks/user_hashtag_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Generate bipartite user-hashtag graph of posts
"""
from backend.lib.preset import ProcessorPreset
from common.lib.user_input import UserInput


__author__ = "Stijn Peeters"
__credits__ = ["Stijn Peeters"]
Expand All @@ -19,6 +21,17 @@ class HashtagUserBipartiteGrapherPreset(ProcessorPreset):
description = "Produces a bipartite graph based on co-occurence of (hash)tags and people. If someone wrote a post with a certain tag, there will be a link between that person and the tag. The more often they appear together, the stronger the link. Tag nodes are weighed on how often they occur. User nodes are weighed on how many posts they've made." # description displayed in UI
extension = "gexf" # extension of result file, used internally and in UI

@classmethod
def get_options(cls, parent_dataset=None, user=None):
return {
"to-lowercase": {
"type": UserInput.OPTION_TOGGLE,
"default": False,
"help": "Convert values to lowercase",
"tooltip": "Merges values with varying cases"
}
}

@classmethod
def is_compatible_with(cls, module=None, user=None):
"""
Expand Down Expand Up @@ -58,7 +71,8 @@ def get_processor_pipeline(self):
"directed": False,
"split-comma": True,
"categorise": True,
"allow-loops": False
"allow-loops": False,
"to-lowercase": self.parameters.get("to-lowercase", False),
}
}
]
Expand Down

0 comments on commit 8c83df7

Please sign in to comment.