### Quick Start with OpenAI API (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Installs the OpenAI Python library, sets the API key environment variable, navigates to the scripts directory, and executes the main run script for the OpenAI backend. Requires a valid OpenAI API key. ```Bash pip install openai export OPENAI_API_KEY="" cd scripts bash run.sh ``` -------------------------------- ### Quick Start with Open Source Models (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Installs the vLLM Python library, navigates to the scripts directory, and executes the run script for open-source models using vLLM. Requires vLLM to be installed correctly and potentially a compatible model. ```Bash pip install vllm cd scripts bash run_llm.sh ``` -------------------------------- ### Setup Evaluation Environment (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Installs the required Python package 'tiktoken' and sets the OPENAI_API_KEY environment variable necessary for the model-based evaluation. ```Bash pip install tiktoken export OPENAI_API_KEY="" ``` -------------------------------- ### Install All Dependencies from requirements.txt (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Installs all project dependencies listed in the `requirements.txt` file using pip. This is the recommended way to set up the complete environment. ```Bash pip install -r requirements.txt ``` -------------------------------- ### Install OpenAI and vLLM Dependencies (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Installs the necessary Python packages (`openai` and `vllm`) individually using pip. This is an alternative to installing all dependencies from `requirements.txt`. ```Bash pip install openai pip install vllm ``` -------------------------------- ### Example Evaluation Output (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Illustrates the typical output format and content generated by the evaluation script after completing a run, showing the evaluation summary including score, validity, and usage summary with token counts and costs. ```Bash ======================================== ๐ŸŒŸ Evaluation Summary ๐ŸŒŸ ๐Ÿ“„ Paper name: Transformer ๐Ÿงช Evaluation type: ref_based ๐Ÿ“ Target repo directory: ../outputs/Transformer_repo ๐Ÿ“Š Evaluation result: ๐Ÿ“ˆ Score: 4.5000 โœ… Valid: 8/8 ======================================== ๐ŸŒŸ Usage Summary ๐ŸŒŸ [Evaluation] Transformer - ref_based ๐Ÿ› ๏ธ Model: o3-mini ๐Ÿ“ฅ Input tokens: 44318 (Cost: $0.04874980) ๐Ÿ“ฆ Cached input tokens: 0 (Cost: $0.00000000) ๐Ÿ“ค Output tokens: 26310 (Cost: $0.11576400) ๐Ÿ’ต Current total cost: $0.16451380 ๐Ÿช™ Accumulated total cost so far: $0.16451380 ============================================ ``` -------------------------------- ### Run s2orc-doc2json PDF Processing Service (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Navigates into the `grobid-0.7.3` directory within the cloned `s2orc-doc2json` repository and executes the Gradle run command to start the PDF processing service. This service is a prerequisite for PDF to JSON conversion. ```Bash cd ./s2orc-doc2json/grobid-0.7.3 ./gradlew run ``` -------------------------------- ### Unzipping the dataset (Bash) Source: https://github.com/going-doer/paper2code/blob/main/data/paper2code/README.md This command unzips the main dataset archive, making the paper data available for use. Ensure the 'paper2code_data.zip' file is in the current directory. ```Bash unzip paper2code_data.zip ``` -------------------------------- ### Run PaperCoder with OpenAI API (PDF Input) (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Sets the OpenAI API key environment variable, navigates to the scripts directory, and executes the main run script (`run.sh`) to process a paper using the OpenAI API, assuming the paper input is in the PDF-based JSON format. ```Bash export OPENAI_API_KEY="" cd scripts bash run.sh ``` -------------------------------- ### Run PaperCoder with OpenAI API (LaTeX Input) (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Sets the OpenAI API key environment variable, navigates to the scripts directory, and executes the LaTeX-specific run script (`run_latex.sh`) to process a paper using the OpenAI API, assuming the paper input is in LaTeX source format. ```Bash export OPENAI_API_KEY="" cd scripts bash run_latex.sh ``` -------------------------------- ### Run PaperCoder with Open Source Models (LaTeX Input) (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Navigates to the scripts directory and executes the vLLM-based LaTeX-specific run script (`run_latex_llm.sh`) to process a paper using open-source models via vLLM, assuming the paper input is in LaTeX source format. ```Bash cd scripts bash run_latex_llm.sh ``` -------------------------------- ### Run PaperCoder with Open Source Models (PDF Input) (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Navigates to the scripts directory and executes the vLLM-based run script (`run_llm.sh`) to process a paper using open-source models via vLLM, assuming the paper input is in the PDF-based JSON format. ```Bash cd scripts bash run_llm.sh ``` -------------------------------- ### Run Reference-based Evaluation (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Executes the 'eval.py' script from the 'codes/' directory to perform a reference-based evaluation of a generated repository against a gold standard repository. Requires specifying the paper name, paths to the PDF JSON, data, output, target repository, gold repository, and results directories, evaluation type, number of generated samples, and enabling the papercoder flag. ```Bash cd codes/ python eval.py \ --paper_name Transformer \ --pdf_json_path ../examples/Transformer_cleaned.json \ --data_dir ../data \ --output_dir ../outputs/Transformer \ --target_repo_dir ../outputs/Transformer_repo \ --gold_repo_dir ../examples/Transformer_gold_repo \ --eval_result_dir ../results \ --eval_type ref_based \ --generated_n 8 \ --papercoder ``` -------------------------------- ### Run Reference-free Evaluation (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Executes the 'eval.py' script from the 'codes/' directory to perform a reference-free evaluation of a generated repository. Requires specifying the paper name, paths to the PDF JSON, data, output, target repository, and results directories, evaluation type, number of generated samples, and enabling the papercoder flag. ```Bash cd codes/ python eval.py \ --paper_name Transformer \ --pdf_json_path ../examples/Transformer_cleaned.json \ --data_dir ../data \ --output_dir ../outputs/Transformer \ --target_repo_dir ../outputs/Transformer_repo \ --eval_result_dir ../results \ --eval_type ref_free \ --generated_n 8 \ --papercoder ``` -------------------------------- ### Listing Python Dependencies Source: https://github.com/going-doer/paper2code/blob/main/requirements.txt This snippet lists the required Python packages and their minimum versions for the project, typically used in a requirements.txt file. ```Python openai>=1.65.4 vllm>=0.6.4.post1 transformers>=4.46.3 tiktoken>=0.9.0 ``` -------------------------------- ### Clone s2orc-doc2json Repository (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Clones the `s2orc-doc2json` GitHub repository, which is required for converting paper PDFs into a structured JSON format used by PaperCoder. ```Bash git clone https://github.com/allenai/s2orc-doc2json.git ``` -------------------------------- ### Convert PDF to JSON using s2orc-doc2json (Bash) Source: https://github.com/going-doer/paper2code/blob/main/README.md Creates an output directory, then runs a Python script from the `s2orc-doc2json` repository to convert a specified PDF file (`${PDF_PATH}`) into a structured JSON format. Requires the PDF processing service to be running. ```Bash mkdir -p ./s2orc-doc2json/output_dir/paper_coder python ./s2orc-doc2json/doc2json/grobid2json/process_pdf.py \ -i ${PDF_PATH} \ -t ./s2orc-doc2json/temp_dir/ \ -o ./s2orc-doc2json/output_dir/paper_coder ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.