Git Product home page Git Product logo

llm4dpcg's Introduction

Large Language Models for Patent Claim Generation

This repository is the code for generating patent claims based on the patent description. It supports fine-tuning and multi-task fine-tuning of the Llama-3 model. It also includes the inference code for Llama-3 and GPT-based models from OpenAI.

Environment setup

sh init_env.sh

Training

cd src
accelerate launch --config_file accelerate_ds_config.yaml pefts/mft_accelerate.py --train_config configs/lora_train_config.json --distributed_type "DeepSpeed" 

Inference

For Llama-3 inference:

python hf_inference.py --base_model [path to the base model] --peft_path [path to the trained adapter] --directory [test data directory]

For OpenAI inference:

python openai_inference.py --openai_key [your key] --model_name [model name] --data_dir [test data directory]

Evaluation

python eval.py --model_name [model outputs for evaluation] --data_dir [test data directory]

Acknowledgement

The code is built based on MFTCoder, a multi-task fine-tuning framework.

Citation

If you find our work useful for your research, please feel free to cite our paper.

@article{jiang2024can,
  title={Can Large Language Models Generate High-quality Patent Claims?},
  author={Lekang Jiang and Caiqi Zhang and Pascal A Scherz and Stephan Goetz},
  journal={arXiv preprint arXiv:2406.19465},
  year={2024}
}

llm4dpcg's People

Watchers

L. Jiang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.