Open maitnngo2002 opened 1 year ago
Hi @maitnngo2002!
Thank you for your pull request and welcome to our community.
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.
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!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
Consider including the full list of generated names.
Done. Added the txt file and cited the link in the description (https://github.com/maitnngo2002/labgraph/blob/labgraph-pilot/keyword.txt)
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:
keyword_generation.py
file, create a constant for KeywordGeneration class and run theextract_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 astest = KeywordGeneration()
and runtest.extract_keywords()
, we should see the output in the terminal as shown below:decription_to_code.py
file, create a constant for DescriptionToCode class and run theget_code_from_description
function with an arbitrary API keyword as a parameter. For example, initiate the instance astest = 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: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: