https://github.com/cltl-students/zhang_yijing_ask_follow_up_questions_for_health_monitoring_using_gen_models

https://github.com/cltl-students/zhang_yijing_ask_follow_up_questions_for_health_monitoring_using_gen_models

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: cltl-students
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: master
  • Size: 7.61 MB
Statistics
  • Stars: 0
  • Watchers: 7
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

Zhangyijingaskfollowupquestionsforhealthmonitoringusinggen_models

Master's Degree in Linguistics: Text Mining, Vrije Universiteit Amsterdam 2023/2024

This repository provides the codes and datasets used in the thesis: Ask Follow-up Questions for Health Monitoring Using Generative Models

Project Structure

Data

  • predefined_data/: Contains predefined datasets for prompt generation.

    • custom_valid_words.json: A customized list of words identified as invalid but potentially valid.
    • examples.json: Examples used for few-shot prompting.
    • icf_cate_comb.json: ICF sub-categories with definitions, sub-activities, and examples for generating prompts.
    • icf_def.json: ICF categories and their definitions for generating prompts.
  • response_data/: Contains conversation data generated by GPT-3.5 and processed follow-up questions.

    • raw_conversations/: Raw conversations generated by GPT-3.5.
    • Communication.json
    • mobility.json
    • self-care.json
    • split_conversations/: Cleaned and split conversation data into training, validation, and test sets.
    • communication/
      • test.json
      • train_1.json
      • val_1.json
    • (Same structure for mobility and self-care)
    • raw_fq/: Raw follow-up questions generated by GPT-3.5.
    • fewshot/: Questions generated using few-shot prompting.
    • zeroshot/: Questions generated using zero-shot prompting.
    • clean_fq/: Cleaned follow-up questions.
    • test_data/: Contains test inputs and reference outputs.
    • in_conver/: Input conversation data.
    • out_fq/: Output follow-up questions.
      • out_clean/
      • out_raw/
    • references/: Reference data used for evaluation.
    • results/: Evaluation scores of the models.

Scripts and Notebooks

This includes code: data-related and colab:model-related

code

  • s1_valid_words.py: Script to create predefined data.
  • data_process.py: Script for initial data processing.
  • s2_data_process_new.py: Updated data processing script.
  • s3_evaluation.py: Script to evaluate the final results.

    • Note: Run the scripts in the order listed here (until Evaluation.ipynb).
  • Data_Prompt.ipynb: Jupyter notebook for zero-shot and few-shot prompting using GPT-3.5 to generate conversations and follow-up questions (FQs).

  • save_doc.ipynb: Notebook to push test data to Google Sheets for collaborative reference creation.

  • export_reference.ipynb: Export selected and revised test conversations used for generating reference outputs.

  • Llama-3_train_fewshot.ipynb: Use Llama-3 with few-shot prompting to generate reference outputs.

  • Llama-3_train_zeroshot.ipynb: Use Llama-3 with zero-shot prompting to generate reference outputs.

  • base_llama.ipynb: Use Llama-3 with basic instructions to generate reference outputs.

  • ft_Llama-3_train_onfewshot.ipynb: Fine-tune Llama-3 with training data generated by few-shot prompting with GPT-3.5, and infer the results from the fine-tuned model.

  • ft_Llama-3_train_onzeroshot.ipynb: Fine-tune Llama-3 with training data generated by zero-shot prompting with GPT-3.5, and infer the results from the fine-tuned model.

  • Evaluation.ipynb: Evaluate all resulting sentences against the reference data.

colab

  • Llama-3_train_fewshot.ipynb: Use Llama-3 with few-shot prompting to generate reference outputs.
  • Llama-3_train_zeroshot.ipynb: Use Llama-3 with zero-shot prompting to generate reference outputs.
  • base_llama.ipynb: Use Llama-3 with basic instructions to generate reference outputs.
  • ft_Llama-3_train_onfewshot.ipynb: Fine-tune Llama-3 with training data generated by few-shot prompting with GPT-3.5, and infer the results from the fine-tuned model.
  • ft_Llama-3_train_onzeroshot.ipynb: Fine-tune Llama-3 with training data generated by zero-shot prompting with GPT-3.5, and infer the results from the fine-tuned model.

Requirements

  • requirements.txt: Contains all the packages used in this project. Ensure you have all dependencies installed before running the scripts.

Steps to Run the Project

  1. Install Dependencies: Run pip install -r requirements.txt to install all necessary packages.
  2. Set Up Paths: Ensure that your working directory is set to the Data folder before running any scripts.
  3. Configure Google Drive: If using Google Sheets for collaborative work, update the API key or authentication credentials as required.
  4. Execute Notebooks: Follow the order mentioned in code until Evaluation.ipynb, then run five notebooks in colab and finally run Evaluation.ipynb in code. This will ensure the correct sequence of data processing, model training, and evaluation.

Thesis Report

TheUseandComparisonofPromptEngineeringApproachesUsedforFollowupQuestion_Generation.pdf

References

The code for prompting GPT-3.5 is inspired by ICF-activities-classifier, specifically 1.gptgeneratedconversations.ipynb. The code for fine-tuning llama3 is adopted from unslothai

Owner

  • Name: Computational Lexicology and & Terminology Lab
  • Login: cltl-students
  • Kind: organization
  • Email: p.t.j.m.vossen@vu.nl
  • Location: Amsterdam

Thesis and student projects @cltl

GitHub Events

Total
  • Fork event: 1
Last Year
  • Fork event: 1

Dependencies

requirements.txt pypi
  • Jinja2 ==3.1.4
  • MarkupSafe ==2.1.5
  • PyYAML ==6.0.1
  • Pygments ==2.18.0
  • absl-py ==2.1.0
  • aiohttp ==3.9.5
  • aiosignal ==1.3.1
  • annotated-types ==0.6.0
  • anyio ==4.3.0
  • asttokens ==2.4.1
  • attrs ==23.2.0
  • beautifulsoup4 ==4.12.3
  • bert-score ==0.3.13
  • blis ==0.7.11
  • cachetools ==5.4.0
  • catalogue ==2.0.10
  • certifi ==2024.2.2
  • charset-normalizer ==3.3.2
  • click ==8.1.7
  • cloudpathlib ==0.18.1
  • comm ==0.2.2
  • confection ==0.1.5
  • contourpy ==1.2.1
  • cycler ==0.12.1
  • cymem ==2.0.8
  • datasets ==2.20.0
  • decorator ==5.1.1
  • dill ==0.3.8
  • diskcache ==5.6.3
  • distro ==1.9.0
  • dnspython ==2.6.1
  • email_validator ==2.1.1
  • evaluate ==0.4.2
  • executing ==2.0.1
  • fastapi ==0.111.0
  • fastapi-cli ==0.0.3
  • filelock ==3.14.0
  • fonttools ==4.53.1
  • frozenlist ==1.4.1
  • fsspec ==2024.5.0
  • gensim ==4.3.2
  • gibberish-detector ==0.1.1
  • google-auth ==2.32.0
  • google-auth-oauthlib ==1.2.1
  • gspread ==6.1.2
  • h11 ==0.14.0
  • httpcore ==1.0.5
  • httplib2 ==0.22.0
  • httptools ==0.6.1
  • httpx ==0.27.0
  • huggingface-hub ==0.23.3
  • idna ==3.7
  • install ==1.3.5
  • ipython ==8.26.0
  • ipywidgets ==8.1.3
  • jedi ==0.19.1
  • joblib ==1.4.2
  • jupyterlab_widgets ==3.0.11
  • kiwisolver ==1.4.5
  • langcodes ==3.4.0
  • language-tool-python ==2.8
  • language_data ==1.2.0
  • llama_cpp_python ==0.2.69
  • marisa-trie ==1.2.0
  • markdown-it-py ==3.0.0
  • matplotlib ==3.9.1
  • matplotlib-inline ==0.1.7
  • mdurl ==0.1.2
  • mpmath ==1.3.0
  • multidict ==6.0.5
  • multiprocess ==0.70.16
  • murmurhash ==1.0.10
  • networkx ==3.3
  • nltk ==3.8.1
  • numpy ==1.25.2
  • nvidia-cublas-cu12 ==12.1.3.1
  • nvidia-cuda-cupti-cu12 ==12.1.105
  • nvidia-cuda-nvrtc-cu12 ==12.1.105
  • nvidia-cuda-runtime-cu12 ==12.1.105
  • nvidia-cudnn-cu12 ==8.9.2.26
  • nvidia-cufft-cu12 ==11.0.2.54
  • nvidia-curand-cu12 ==10.3.2.106
  • nvidia-cusolver-cu12 ==11.4.5.107
  • nvidia-cusparse-cu12 ==12.1.0.106
  • nvidia-nccl-cu12 ==2.20.5
  • nvidia-nvjitlink-cu12 ==12.5.40
  • nvidia-nvtx-cu12 ==12.1.105
  • oauth2client ==4.1.3
  • oauthlib ==3.2.2
  • openai ==1.26.0
  • orjson ==3.10.3
  • packaging ==24.1
  • pandas ==2.2.2
  • parso ==0.8.4
  • pexpect ==4.9.0
  • pillow ==10.4.0
  • preshed ==3.0.9
  • prompt_toolkit ==3.0.47
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • pyarrow ==17.0.0
  • pyarrow-hotfix ==0.6
  • pyasn1 ==0.6.0
  • pyasn1_modules ==0.4.0
  • pydantic ==2.7.1
  • pydantic-settings ==2.2.1
  • pydantic_core ==2.18.2
  • pyparsing ==3.1.2
  • python-dateutil ==2.9.0.post0
  • python-dotenv ==1.0.1
  • python-multipart ==0.0.9
  • pytz ==2024.1
  • regex ==2024.5.15
  • requests ==2.32.3
  • requests-oauthlib ==2.0.0
  • rich ==13.7.1
  • rouge-score ==0.1.2
  • rsa ==4.9
  • safetensors ==0.4.3
  • scikit-learn ==1.5.0
  • scipy ==1.9.3
  • sentence-transformers ==3.0.1
  • shellingham ==1.5.4
  • six ==1.16.0
  • smart-open ==7.0.4
  • sniffio ==1.3.1
  • soupsieve ==2.5
  • spacy ==3.7.5
  • spacy-legacy ==3.0.12
  • spacy-loggers ==1.0.5
  • srsly ==2.4.8
  • sse-starlette ==2.1.0
  • stack-data ==0.6.3
  • starlette ==0.37.2
  • starlette-context ==0.3.6
  • sympy ==1.12.1
  • thinc ==8.2.4
  • threadpoolctl ==3.5.0
  • tokenizers ==0.19.1
  • torch ==2.3.1
  • tqdm ==4.66.4
  • traitlets ==5.14.3
  • transformers ==4.41.2
  • triton ==2.3.1
  • typer ==0.12.3
  • typing_extensions ==4.11.0
  • tzdata ==2024.1
  • ujson ==5.9.0
  • urllib3 ==2.2.1
  • uvicorn ==0.29.0
  • uvloop ==0.19.0
  • wasabi ==1.1.3
  • watchfiles ==0.21.0
  • wcwidth ==0.2.13
  • weasel ==0.4.1
  • websockets ==12.0
  • widgetsnbextension ==4.0.11
  • wrapt ==1.16.0
  • xxhash ==3.4.1
  • yarl ==1.9.4