-
Notifications
You must be signed in to change notification settings - Fork 34
Adding blueprints and notebooks for Navigator Text-Code #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a4d4f23
Add text-to-sql blueprint
dhruvnathawani 0593f31
Change location of notebook
dhruvnathawani 4ed4757
Add text-to-sql blueprint
dhruvnathawani 7def524
Add text-to-sql blueprint
dhruvnathawani d6706b4
Change blueprint name
dhruvnathawani 62e9640
Change notebook name and location
dhruvnathawani a772145
Change name
dhruvnathawani 383dc75
sql context
dhruvnathawani 6c57ef2
Change prompt
dhruvnathawani cd8ea57
text-python blueprint
dhruvnathawani f01b54c
Notebook for Text-Python
dhruvnathawani 65acc00
dataset
dhruvnathawani a517552
name changes
dhruvnathawani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
config_templates/gretel/navigator/navigator_text_python.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| model_suite: Apache-2.0 | ||
|
|
||
| special_system_instructions: >- | ||
| You are an expert at writing Python code and technical documentation. You are obsessed with writing clean, | ||
| efficient, and maintainable code. You are tasked with generating Python code and natural | ||
| language text that will be used to train a language model that will be used to generate Python code. | ||
|
|
||
| seed_categories: | ||
| - name: domain | ||
| description: Major industry domain or sector that relies on robust software solutions | ||
| values: [Healthcare, Finance, Retail, Manufacturing, Education, Public Health, Science and Technology, Environmental Science, Government, Media and Entertainment, | ||
| Transportation, Energy, Agriculture, Manufacturing, Food and Beverage, Wellness, Construction, Automotive, Telecommunications, Public Services, Financial Services, | ||
| Medicine, Social Services, Education and Training, Information and Communications, Environment, Textiles, Startups, Legal and Law, Entertainment, Pharmaceuticals, | ||
| Food Service, Advertising, Financial Planning, Travel and Tourism, Waste Management, E-commerce, Hospitality, Philanthropy, Public Health, Sports, Social Media, | ||
| Venture Capital, Arts and Culture, Economics, Artificial Intelligence, Biotechnology, Renewable Energy and Sustainability, Business and Entrepreneurship, | ||
| Defense and Aerospace, Logistics, Oil and Gas, Fashion and Apparel, Human Resources, Music, Nonprofit, Gaming, Insurance, Space Exploration, Banking, Smart Cities, | ||
| Recreation, Maritime, Electricity, Gas & Water Services, Wholesale Trade, Hotel and Resorts, Rental Services, Fitness, Agricultural Technology, Consulting, Analytics, | ||
| Chemicals, Urban Planning, Internet of Things, Global Trade, Automation Technology, Journalism, Engineering, Psychology, Scientific Research, Publishing, Cybersecurity, | ||
| Credit Cards & Loans, Robotics & Computing, Digital Health, Consumer Electronics, Business Intelligence, Market Research, Sales Forecasting, Data Governance, Digital Marketing] | ||
| subcategories: | ||
| - name: topic | ||
| num_values_to_generate: 25 | ||
| description: Key topics that professional Python developers care about for corresponding | ||
|
|
||
| - name: code_complexity | ||
| description: Complexity of the Python code. | ||
| values: | ||
| - "Intermediate: Control flow, functions, and modules" | ||
| - "Advanced: Classes, inheritance, and exceptions" | ||
| - "Expert: Decorators, generators, and context managers" | ||
|
|
||
| - name: natural_language_type | ||
| description: Type of natural language that will be paired with a block of code | ||
| num_values_to_generate: 10 | ||
| values: | ||
| - a natural language prompt for a Python coding task. | ||
| - a question about how to solve a problem using a Python program | ||
| - a code description that would appear at the top of a function, class, or module | ||
| - an instruction that instructs a user to write Python code for a specific task | ||
|
|
||
| data_columns: | ||
| - name: natural_language_prompt | ||
| description: Natural language text that will be paired with a block of Python code | ||
| specific_instructions: "Generate {natural_language_type} that is relevant to {topic} in the {domain} industry. Ensure that the prompt you generate is specific, accurate and detailed" | ||
|
|
||
| - name: suggested_packages | ||
| description: Suggested Python packages that are commonly used in the {domain} industry | ||
| specific_instructions: "Suggest up to 4 Python packages that are commonly used in the {domain} industry." | ||
| output_type: list | ||
| relevant_columns: [domain, topic, natural_language_prompt] | ||
|
|
||
| - name: code | ||
| description: Python code that will be paired with natural language text. | ||
| specific_instructions: "{natural_language_prompt}" | ||
| relevant_columns: [domain, topic, code_complexity, suggested_packages] | ||
| output_type: code | ||
| llm_type: code | ||
|
|
||
| data_validators: | ||
| - validator: code | ||
| code_lang: python | ||
| code_columns: [code] | ||
109 changes: 109 additions & 0 deletions
109
config_templates/gretel/navigator/navigator_text_sql.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| model_suite: Apache-2.0 | ||
|
|
||
| special_system_instructions: >- | ||
| You are an expert at writing SQL queries and technical documentation. You are obsessed with writing | ||
| clean, efficient, and maintainable SQL code. You are tasked with generating SQL queries and natural | ||
| language text that will be used to train a language model that will be used to generate SQL queries. | ||
|
|
||
| seed_categories: | ||
| - name: domain | ||
| description: Major industry domain or sector that relies on robust data solutions | ||
| values: [Healthcare, Finance, Retail, Manufacturing, Education, Public Health, Science and Technology, Environmental Science, Government, Media and Entertainment, | ||
| Transportation, Energy, Agriculture, Manufacturing, Food and Beverage, Wellness, Construction, Automotive, Telecommunications, Public Services, Financial Services, | ||
| Medicine, Social Services, Education and Training, Information and Communications, Environment, Textiles, Startups, Legal and Law, Entertainment, Pharmaceuticals, | ||
| Food Service, Advertising, Financial Planning, Travel and Tourism, Waste Management, E-commerce, Hospitality, Philanthropy, Public Health, Sports, Social Media, | ||
| Venture Capital, Arts and Culture, Economics, Artificial Intelligence, Biotechnology, Renewable Energy and Sustainability, Business and Entrepreneurship, | ||
| Defense and Aerospace, Logistics, Oil and Gas, Fashion and Apparel, Human Resources, Music, Nonprofit, Gaming, Insurance, Space Exploration, Banking, Smart Cities, | ||
| Recreation, Maritime, Electricity, Gas & Water Services, Wholesale Trade, Hotel and Resorts, Rental Services, Fitness, Agricultural Technology, Consulting, Analytics, | ||
| Chemicals, Urban Planning, Internet of Things, Global Trade, Automation Technology, Journalism, Engineering, Psychology, Scientific Research, Publishing, Cybersecurity, | ||
| Credit Cards & Loans, Robotics & Computing, Digital Health, Consumer Electronics, Business Intelligence, Market Research, Sales Forecasting, Data Governance, Digital Marketing] | ||
| subcategories: | ||
| - name: topic | ||
| description: Key topics that professional SQL developers care about in the given domain | ||
| num_values_to_generate: 25 | ||
|
|
||
| - name: sql_complexity | ||
| description: Complexity of the SQL query, ranging from basic operations to advanced data processing techniques | ||
| values: | ||
| - "Basic SQL" | ||
| - "Aggregation" | ||
| - "Single Join" | ||
| - "Subquery" | ||
| - "Multiple Join" | ||
| - "Window Functions" | ||
|
|
||
| - name: sql_task_type | ||
| description: Type of SQL task that the query represents | ||
| num_values_to_generate: 25 | ||
| values: | ||
| - "Data Retrieval" | ||
| - "Data Definition" | ||
| - "Data Manipulation" | ||
| - "Analytics and Reporting" | ||
| - "Database Administration" | ||
| - "Data Cleaning and Transformation" | ||
|
|
||
| - name: natural_language_type | ||
| description: Type of natural language that will be paired with an SQL query | ||
| num_values_to_generate: 25 | ||
| values: | ||
| - "a natural language prompt for an SQL query" | ||
| - "a question about how to extract information from a database using SQL" | ||
| - "an explanation of what an SQL query is doing" | ||
| - "an instruction that tells a user to write an SQL query for a specific task" | ||
|
|
||
| - name: data_generation_mode | ||
| description: Mode of data generation for different contexts | ||
| values: | ||
| - "Creation" | ||
| - "Editing" | ||
| - "Augmentation" | ||
| - "Sequential" | ||
| - "Time Series" | ||
|
|
||
| data_columns: | ||
| - name: domain_description | ||
| description: Detailed description of the {domain} | ||
| specific_instructions: "Provide a detailed description of the {domain} that includes one key areas of focus for a subdomain for writing SQL." | ||
|
|
||
| - name: sql_complexity_description | ||
| description: Description of the complexity level of the SQL query | ||
| specific_instructions: "Provide a description for the {sql_complexity} level, highlighting the types of SQL operations involved." | ||
| relevant_columns: [sql_complexity] | ||
|
|
||
| - name: sql_task_type_description | ||
| description: Description of the type of SQL task | ||
| specific_instructions: "Provide a description for the {sql_task_type}, including its typical use cases in the {domain} industry." | ||
| relevant_columns: [sql_task_type, domain] | ||
|
|
||
| - name: sql_prompt | ||
| description: Natural language prompt that will be paired with an SQL query | ||
| specific_instructions: "You are an expert engineer, well versed in prompt tuning for LLMs. | ||
| Create a natural language prompt to generate SQL in the field of {domain}, specifically about the domain of {topic}. | ||
| Feel free to ask for data that focus on a smaller subject within the scope of {natural_language_type}. | ||
| " | ||
| relevant_columns: [domain, topic, natural_language_type] | ||
|
|
||
| - name: sql_context | ||
| description: SQL context that provides additional information, such as table or view creation statements | ||
| specific_instructions: "Generate SQL statement as context that is relevant to the {domain} industry and aligns with the {topic} and {sql_prompt}" | ||
| relevant_columns: [domain, topic, sql_prompt] | ||
| output_type: code | ||
| llm_type: code | ||
|
|
||
| - name: sql | ||
| description: SQL query that will be paired with natural language text | ||
| specific_instructions: "Write an SQL query to accomplish the task described by {sql_prompt}. Use the provided {sql_context} if applicable." | ||
| relevant_columns: [domain, topic, sql_complexity, sql_task_type, sql_context, sql_prompt] | ||
| output_type: code | ||
| llm_type: code | ||
|
|
||
| - name: sql_explanation | ||
| description: Natural language explanation of what the SQL query is doing | ||
| specific_instructions: "Provide a detailed explanation of the SQL query, including the purpose of each clause and how it contributes to achieving the task described by {sql_prompt}." | ||
| relevant_columns: [sql_prompt, sql, sql_context] | ||
|
|
||
| data_validators: | ||
| - validator: code | ||
| code_lang: ansi | ||
| code_columns: [sql, sql_context] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing a ton of domains, planning to add 5-10 for the final notebook