asreview.Project#
- class asreview.Project(project_path, project_id=None)[source]#
Bases:
object
Project class for ASReview project files.
Methods
__init__
(project_path[, project_id])add_dataset
(fp[, dataset_id, file_writer])Add a dataset to the project file.
add_feature_matrix
(feature_matrix, name)Add feature matrix to project file.
add_review
([review_id, cycle, reviewer, status])Add new review metadata.
create
(project_path[, project_id, ...])Initialize the necessary files specific to the web app.
delete_review
([remove_folders])export
(export_fp)get_feature_matrix
(name)Get the feature matrix from the project file.
get_review_error
([review_id])load
(asreview_file, project_path[, ...])mark_review_finished
([review_id])Mark a review in the project as finished.
read_input_data
([reader])Remove dataset from project.
remove_review_error
([review_id])set_review_error
(err[, review_id])update_config
(**kwargs)Update project info
update_review
([review_id, cycle, state])Update review metadata.
Attributes
- add_dataset(fp, dataset_id=None, file_writer=None)[source]#
Add a dataset to the project file.
- Parameters:
fp (str, Path) – Filepath to the dataset. It will be copied to the correct location in the project file.
- add_feature_matrix(feature_matrix, name)[source]#
Add feature matrix to project file.
- Parameters:
feature_matrix (numpy.ndarray, scipy.sparse.csr.csr_matrix) – The feature matrix to add to the project file.
name (str) – Name of the feature extractor.
- add_review(review_id=None, cycle=None, reviewer=None, status='setup')[source]#
Add new review metadata.
- Parameters:
review_id (str) – The review_id uuid4.
cycle – An active learning cycle object to add to the review. This object is used to store the configuration of the active learning cycle to file.
reviewer (object) – A reviewer object with to_sql() method.
status (str) – The status of the review. One of ‘setup’, ‘running’, ‘finished’.
- property config#
- classmethod create(project_path, project_id=None, project_mode='oracle', project_name=None, project_tags=None)[source]#
Initialize the necessary files specific to the web app.
- property data_dir#
- property data_store#
- property feature_matrices#
- get_feature_matrix(name)[source]#
Get the feature matrix from the project file.
- Parameters:
name (str) – Name of the feature extractor for which to get the cached matrix.
- Returns:
numpy.ndarray, scipy.sparse – (Sparse) feature matrix.
- classmethod load(asreview_file, project_path, safe_import=False, reset_model_if_not_found=False)[source]#
- mark_review_finished(review_id=None)[source]#
Mark a review in the project as finished.
If no review_id is given, mark the first review as finished.
- Parameters:
review_id (str) – Identifier of the review to mark as finished.
- property reviews#