Project

General

Profile

Feature #3641

Task #3653: Launch with first chapter support - Phase 1 - Practice for Decent Learners (Top 5 Themes, No DetailedQNAs, No Detailed Answers)

Support for create_styled_questions colab notebook

Added by Ram Kordale 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
High
Assignee:
Start date:
06/30/2024
Due date:
% Done:

100%

Estimated time:

Description

Let the first cell contain all inputs. Inputs are questions_file, model, index, board, grade, subject, chapter_num, styles (which is an array of strings)

Also, set CONTEXT_SIZE to 40960 in the first cell.

questions_file has the format:
E1
E2
...

where Ei is of format

#$Exercise: <exercise#> (example: 1.2.5.1)
#$Question: <question>
#$Figure: <questions_figure_list> [comment:List of <GCS URLs> for jpg files]
#$Answer: <answer>
#$Figure: <answers_figure_list> [comment:List of <GCS URLs> for jpg files]

\-for every <style> in styles
\--template[key, value] = ["stylexyz1abc", <style>]
\--num_tokens=0
\--for every question in the file
\--prompt=<question>
\--response,num_tokens=call_openai_api(version=1.0, prompt, attachments, template, "temperature": 1, "max_tokens": 4096, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0) [comment: attachments = <questions_figure_list>]
\---if (num_tokens > CONTEXT_SIZE) num_tokens=0
\---styled_question = content between "###---###---###" in response
\---store styled_question and answer with key <board>-<grade>-<subject>-<chapter>-<exercise>-<style>
\---if <board>-<grade>-<subject>-<chapter>-<exercise>-standard does not exist
\----store <question> and answer with key <board>-<grade>-<subject>-<chapter>-<exercise>-standard.

You can start with a single entry file such as
#$Exercise: 1.2.5.1
#$Question: Maya dyes dresses. She had to dye 30 dresses. She has so far finished 20 dresses. What fraction of dresses has she finished?
#$Answer: 2/3

Also available in: Atom PDF