<commit_before>Studio bulk corrections
=======================
The command line script `corrections` allows to perform bulk corrections of 
titles, descriptions, and other attributes for the content nodes of a channel.


Use cases:
  - Bulk modify titles and descriptions (e.g. to fix typos)
  - Translate titles and/or descriptions (for sources with missing structure translations)
  - Enhance content by adding description (case by case detail work done during QA)
  - Add missing metadata like author, copyright holder, and tags to content nodes
  - Perform basic structural edits to channel (remove unwanted topics and content nodes)

Not use cases:
  - Modify a few node attributes (better do manually through the Studio web interface)
  - Structural changes (the corrections workflow does not support node moves)
  - Global changes (if the same modification must be performed on all nodes in the
    channel, it would be better to implement these changes during cheffing)


Corrections workflow
--------------------
The starting point is an existing channel available on Studio, which we will
identify through its Channel ID, denoted `<channel_id>` in code examples below.

### Step 1: Export the channel metadata to CSV
Export the complete metadata of the source channel as a local `.csv` file using:

    corrections export <channel_id>

This will create the file `corrections-export.csv` which can be opened with a
spreadsheet program (e.g. LibreOffice). In order to allow for collaboration,
the content of the spreadsheet must be copied to a shared google sheet with
permissions set to allow external edits.


### Step 2: Edit metadata
In this step the content expert (internal or external) edits the metadata for
each content node in the shared google sheet.
The possible actions (first column) to apply to each row are as follows:
  - `modify`: to apply metadata modifications to the topic or content node
  - `delete`: to remove the topic or content node from the channel
  - Leaving the Action column blank will leave the content node unchanged<commit_msg>added info about credentials needed for corrections<commit_after>Studio bulk corrections
=======================
The command line script `corrections` allows to perform bulk corrections of 
titles, descriptions, and other attributes for the content nodes of a channel.


Use cases:
  - Bulk modify titles and descriptions (e.g. to fix typos)
  - Translate titles and/or descriptions (for sources with missing structure translations)
  - Enhance content by adding description (case by case detail work done during QA)
  - Add missing metadata like author, copyright holder, and tags to content nodes
  - Perform basic structural edits to channel (remove unwanted topics and content nodes)

Not use cases:
  - Modify a few node attributes (better do manually through the Studio web interface)
  - Structural changes (the corrections workflow does not support node moves)
  - Global changes (if the same modification must be performed on all nodes in the
    channel, it would be better to implement these changes during cheffing)


Credentials
-----------
In order to use the corrections workflow as part of a chef script, you need to
create the file `credentials/studio.json` in the chef repo that contains the
following information:

    {
      "token": "YOURTOKENHERE<PASSWORD>",
      "username": "<EMAIL>",
      "password": "<PASSWORD>",
      "studio_url": "https://studio.learningequality.org"
    }

These credentials will be used to make the necessary Studio API calls. Make sure
you have edit rights for this channel.


Corrections workflow
--------------------
The starting point is an existing channel available on Studio, which we will
identify through its Channel ID, denoted `<channel_id>` in code examples below.

### Step 1: Export the channel metadata to CSV
Export the complete metadata of the source channel as a local `.csv` file using:

    corrections export <channel_id>

This will create the file `corrections-export.csv` which can be opened with a
spreadsheet program (e.g. LibreOffice). In order to allow for collaboration,
the content of the spreadsheet must be copied to a shared google sheet with
permissions set to allow external edits.


### Step 2: Edit metadata
In this step the content expert (internal or external) edits the metadata for
each content node in the shared google sheet.
The possible actions (first column) to apply to each row are as follows:
  - `modify`: to apply metadata modifications to the topic or content node
  - `delete`: to remove the topic or content node from the channel
  - Leaving the Action column blank will leave the content node unchanged
{'fraction_non_alphanumeric': 0.06648140230867892, 'fraction_numerical': 0.0008550662676357417, 'mean_word_length': 4.085869565217391, 'pattern_counts': {'":': 4, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2986903', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1076, 'n_words': 662}