This GitHub repository contains a collection of Python scripts designed for generating, processing, and manipulating question-answer pairs from various text sources. The scripts are tailored for handling data in the context of natural language processing (NLP) and machine learning, particularly using transformers. The repository includes the following key files:
data_gen.py: Generates questions and answers based on provided context sections.main.py: Extracts questions and answers from text and processes them with the Nougat tool.pdfocr.py: Processes PDF files to extract and convert content to a markdown format.temp.py: Exeriments to generate variations of question-answer pairs based on explanations.generation_config.yaml: Configuration file for the generation script.
- Python 3.6 or higher
- PyTorch
- Nougat: follow installation process from here
- Transformers library
- Pandas
- YAML
- Purpose: To generate questions and answers from provided text sections.
- Usage: Run
python data_gen.py. Ensure that thegeneration_config.yamlis configured correctly.
- Purpose: To extract questions and answers from provided text and process them.
- Usage: Run
python main.py. The script will process files located in the specified folder path.
- Purpose: To process PDF files and extract text in markdown format.
- Usage: Run
python pdfocr.py. Make sure to have your PDF files in the specified folder path.
- Purpose: To generate variations of question-answer pairs.
- Usage: Run
python temp.pyafter configuringgeneration_config.yamlwith appropriate settings.
- Modify this YAML file to change the settings for question generation, such as the model name, temperature, and other parameters.