Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Labgraph pilot #103

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

maitnngo2002
Copy link

@maitnngo2002 maitnngo2002 commented Feb 25, 2023

Description

This feature is data generation for training purposes.
Scrape API keywords from several predefined urls and pass these keywords to OpenAI API to get the generated code for that each keyword.

The generated code blocks will be saved to a local file. Just specify the directory you want to save the results, and you can go that place to look at the generated code blocks.

Because using OpenAI API requires a API_key, we store it in a .env file (make sure to have .env package installed by pip install dotenv).

Fixes #97

Link to the full list of keywords: https://github.com/maitnngo2002/labgraph/blob/labgraph-pilot/keyword.txt

Feature/Issue validation/testing

To validate if the code works, you can follow these steps:

  1. To test if we have successfully extract the keywords, open the keyword_generation.py file, create a constant for KeywordGeneration class and run the extract_keywords function, you could look at the output in the terminal and a list of expected keywords will be printed. For example, initiate the instance as test = KeywordGeneration() and run test.extract_keywords(), we should see the output in the terminal as shown below:

image

  1. i) To test if the configuration to access the OpenAI API has been successful, open the decription_to_code.py file, create a constant for DescriptionToCode class and run the get_code_from_description function with an arbitrary API keyword as a parameter. For example, initiate the instance as test = DescriptionToCode() and run `test.get_code_from_description('scipy.signal.convolve'), we should get back the expected code block in the terminal as shown below:

image

ii) To generate the code blocks for every single API keyword and save it a local file, run test.get_code() and open the 'output.txt' file to see the result as shown below:
image

image

@facebook-github-bot
Copy link

Hi @maitnngo2002!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 25, 2023
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@jfResearchEng
Copy link
Contributor

Consider including the full list of generated names.

@maitnngo2002
Copy link
Author

Done. Added the txt file and cited the link in the description
(https://github.com/maitnngo2002/labgraph/blob/labgraph-pilot/keyword.txt)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data Generation and Parser from OpenGPT
3 participants