asreview.state.SQLiteState
- class asreview.state.SQLiteState(read_only=True)[source]
Class for storing the review state.
The results are stored in a sqlite database.
- Parameters
read_only (bool) – Open state in read only mode. Default False.
- Variables
version (str) – Return the version number of the state.
settings (asreview.settings.ASReviewSettings) – Return an ASReview settings object with model settings and active learning settings.
n_records_labeled (int) – Get the number of labeled records, where each prior is counted individually.
n_priors (int) – Number of priors. If priors have not been selected returns None.
exist_new_labeled_records (bool) – Have there been labeled records added to the state since the last time a model ranking was added to the state?
model_has_trained (bool) – Has the ranking by a model been added to the state?
Attributes
Return True if there are new labeled records.
Return True if there is data of a trained model in the state.
Number of records added as prior knowledge.
Number of records in the loop.
Number labeled records.
Settings of the ASReview pipeline.
Version number of the state.
Methods
add_labeling_data
(record_ids, labels[, ...])Add the data corresponding to a labeling action to the state file.
add_last_probabilities
(probabilities)Save the probabilities produced by the last classifier.
add_last_ranking
(ranked_record_ids, ...)Save the ranking of the last iteration of the model.
add_note
(note, record_id)Add a text note to save with a labeled record.
add_record_table
(record_ids)Add the record table to the state.
close
()Close the files opened by the state.
delete_record_labeling_data
(record_id)Delete the labeling data for the given record id.
get_balance_strategies
([priors, pending])Get the balance strategies from the state.
get_classifiers
([priors, pending])Get the classifiers from the state.
get_data_by_query_number
(query[, columns])Get the data of a specific query from the results table.
get_data_by_record_id
(record_id[, columns])Get the data of a specific query from the results table.
get_dataset
([columns, priors, pending])Get a subset from the results table.
Get the record ids for any decision changes.
get_feature_extraction
([priors, pending])Get the query strategies from the state.
Get the labeled records in order of labeling.
get_labeling_times
([time_format, priors, ...])Get the time of labeling from the state.
get_labels
([priors, pending])Get the labels from the state.
Get the probabilities produced by the last classifier.
Get the ranking from the state.
get_order_of_labeling
([priors, pending])Get full array of record id's in order that they were labeled.
Get the record_ids of the records pending a labeling decision.
get_pool
()Get the unlabeled, not-pending records in ranking order.
Return the unlabeled pool, labeled and pending records.
get_priors
([columns])Get the record ids of the priors.
get_query_strategies
([priors, pending])Get the query strategies from the state.
Get the record table of the state.
get_training_sets
([priors, pending])Get the training_sets from the state.
is_empty
()Check if state has no results.
Get the top ranked records from the ranking table.
to_dict
()Convert state to dictionary.
update_decision
(record_id, label[, note])Change the label of an already labeled record.