-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "Revert "Add the functionality of semantic clusters into one streamlined main file" (#16)" This reverts commit ff861f2. * Delete semantic_clusters.gif * Remove unused files * Update semantic clustering with PCA * Update semantic clustering with t-sne * Add k_means clustering and finish main pipeline * Delete temporary_test_file.ipynb * Update README.md * Add automatic cluster calculation * Create a file for interactive to use, adjust interactive and add a command line interface Big commit, but all connected * Solve issues with command line interface * Update semantic clustering with pep8 * Fix optimal clusters feature * Move entrypoint to main.py * Add automatic removal of previous data file * Correct licenses * Squashed commit of the following: commit f6383ca Author: Jelle Teijema <[email protected]> Date: Wed Nov 10 10:26:20 2021 +0100 Cluster the imports commit d89df8f Author: Jelle Teijema <[email protected]> Date: Wed Nov 10 10:20:25 2021 +0100 Add an explanation of chosen defaults commit 12c8644 Merge: 926a1b9 5cdc705 Author: Jelle <[email protected]> Date: Tue Nov 9 11:05:01 2021 +0100 Merge branch 'master' into add-automatic-cluster-calculations * Update asreviewcontrib/semantic_clustering/__init__.py Co-authored-by: Jonathan de Bruin <[email protected]> * Update asreviewcontrib/semantic_clustering/main.py Co-authored-by: Jonathan de Bruin <[email protected]> * Formatting of the imports Co-authored-by: Jonathan de Bruin <[email protected]>
- Loading branch information
Showing
4 changed files
with
123 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from asreviewcontrib.semantic_clustering.semantic_clustering import SemanticClustering | ||
from asreviewcontrib.semantic_clustering.interactive import run_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
# Path: asreviewcontrib\semantic_clustering\main.py | ||
|
||
# Environment imports | ||
import sys | ||
import getopt | ||
|
||
from asreview.data import ASReviewData | ||
|
||
from asreviewcontrib.semantic_clustering.interactive import run_app | ||
from asreviewcontrib.semantic_clustering.semantic_clustering import SemanticClustering | ||
|
||
|
||
def main(argv): | ||
filepath = "" | ||
|
||
try: | ||
opts, args = getopt.getopt( | ||
argv, "htf:a", ["help", "testfile", "filepath=", "app"]) | ||
except getopt.GetoptError: | ||
print('Please use the following format:') | ||
print('test.py -f <filepath>') | ||
print('test.py --testfile') | ||
print('test.py --app') | ||
sys.exit(2) | ||
for opt, arg in opts: | ||
if opt in ("-h", "--help"): | ||
print('test.py -f <filepath> or --testfile') | ||
sys.exit() | ||
elif opt in ("-f", "--filepath"): | ||
filepath = arg | ||
elif opt in ("-t", "--testfile"): | ||
filepath = "https://raw.githubusercontent.com/asreview/systematic-review-datasets/master/datasets/van_de_Schoot_2017/output/van_de_Schoot_2017.csv" | ||
elif opt in ("-a", "--app"): | ||
run_app() | ||
sys.exit(1) | ||
print('Running from file: ', filepath) | ||
|
||
# check if arguments are empty | ||
if filepath == "": | ||
print('Please use the following format:') | ||
print('test.py -f <filepath>') | ||
print('test.py --testfile') | ||
print('test.py --app') | ||
sys.exit(2) | ||
|
||
SemanticClustering(ASReviewData.from_file(filepath)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters