-
Notifications
You must be signed in to change notification settings - Fork 0
The Taskframe Class: Exporting Labels
Denis Vilar edited this page Sep 7, 2020
·
1 revision
Once your team has finished annotating your Tasks, you have a few options to export the results.
# Assuming a finished Taskframe:
tf = Taskframe.retrieve("xxxx")
# export to a CSV:
tf.to_csv("local/path/results.csv")
# export to a Pandas Dataframe:
df = tf.to_dataframe()
# Include the resulting labels on a new column of an existing dataframe:
df_with_label_column = tf.merge_to_dataframe(df)Export your results as a CSV Signature:
def to_csv(self, path):Parameters:
-
path: local path where the CSV will be saved.
Returns: None
Example:
# Assuming a finished Taskframe:
tf = Taskframe.retrieve("xxxx")
tf.to_csv("local/path/results.csv")Generate a Pandas dataframe with the results. Signature:
def to_dataframe(self):Parameters: None
Returns: A pandas DataFrame with the results.
Example:
# Assuming a finished Taskframe:
tf = Taskframe.retrieve("xxxx")
df = tf.to_dataframe()If your input Dataset is a Dataframe, you can merge your result labels as a new column in your original Dataframe.
Requires that you had submitted custom_id to be able to join rows.
Signature:
merge_to_dataframe(self, dataframe, custom_id_column):Parameters:
-
dataframe: the dataframe to which we will add a newlabelscolumn -
custom_id_colum: the name of the column containing unique identifiers (should be the same as provided when dataset was initially submitted)
Returns: a copy of the input dataframe with an extra label column containing the results.
Example:
df = pd.DataFrame(...)
tf.add_dataset_from_dataframe(df)
tf.submit()
# Your workers annotate, once it's done:
df = pd.DataFrame(...)
df_with_labels = tf.merge_to_dataframe(df)