Skip to content

Assignment 7 Rmd and pdf Revision #55

Merged
merged 1 commit into from Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 52 additions & 8 deletions StudentNotebooks/Assignment07/liux30_assignment07.Rmd
Expand Up @@ -4,15 +4,18 @@ author: "Xiheng Liu"
date: "`r Sys.Date()`"
output:
pdf_document:
toc: yes
toc: true
toc_depth: '3'
html_notebook: default
html_document:
toc: yes
toc: true
toc_depth: 3
toc_float: yes
number_sections: yes
toc_float: true
number_sections: true
theme: united
word_document:
toc: true
toc_depth: '3'
---

# DAR Project and Group Members
Expand All @@ -22,18 +25,28 @@ output:



# 0.0 Preliminaries.
# 0.0 Preliminaries

This report is generated from an R Markdown file that includes all the R code necessary to produce the results described and embedded in the report.

# 1.0 Project Introduction

DAR-CTEval-F24 evaluates large language models (LLMs) in clinical trial design, focusing on their ability to suggest and evaluate baseline patient features using real trial data. The benchmark measures accuracy and performance by comparing LLM-generated results with actual trial features and human evaluations.

# 2.0 Organization of Report
CTBS, a component of DAR-CTEval-F24, is a specialized tool tailored for clinical trial design. Building upon the ChatBS framework, it serves as a comprehensive benchmark for assessing language model capabilities in this domain.

This report provides a programming guide for the CTBS App.

This report is organize as follows:
Link to Project Github: https://github.rpi.edu/DataINCITE/DAR-CTEval-F24

Link to CTBS Github: https://github.rpi.edu/DataINCITE/DAR-CTBSApp-F24

Link to CTBS App: https://lp01.idea.rpi.edu/shiny/erickj4/DAR-CTBSApp-F24/


# 2.0 Organization of Report

This report is organize as follows:

* Section 3.0 Page 1: 'Step 1: Specify Trial' is divided into left and right sides. There is a button on the left side. After pressing the left button, the right side will change.

Expand All @@ -48,6 +61,8 @@ This report is organize as follows:

# 3.0 Page 1: 'Step 1: Specify Trial'

In 'Step 1: Specify Trial', user can query the Title, Brief Summary, Condition, Eligibility Criteria, Intervention, Outcome, Actual Features of a specific NCT ID in CT_Pub and download it as a JSON document.

The relevant code for this page is as follows:

The code for UI part: line 192-255
Expand All @@ -59,13 +74,20 @@ The code for download in server part: line 1243-1286

## 3.1 Data, Code, and Resources

Here is a list data sets, codes, that are used in CTBS.

1. liux30_assignment07.Rmd (with knit pdf and html) is this notebook.
[https://github.rpi.edu/DataINCITE/DAR-CTEval-F24/blob/main/StudentNotebooks/Assignment07/liux30_assignment07.Rmd](https://github.rpi.edu/DataINCITE/DAR-CTEval-F24/blob/main/StudentNotebooks/Assignment07/liux30_assignment07.Rmd)


## 3.2 Contribution

This page is completed by Xiheng Liu and Tianyan Lin.


## 3.3 Methods Description

I created an observeEvent function for the ‘Load’ button. After clicking the button, it will first determine whether the input NCTid is in the database. If not, it will return ‘Cannot find this NCTId.’. If it is, the row where the NCTid is located will be extracted, and Title, BriefSummary, Condition, EligibilityCriteria, Intervention, and Outcome will be stored separately according to the column names. Then put it in the user prompt template that starts with ‘##Question:’ and ends with ‘##Answer:’. It will then be transmitted to LLM.


## 3.4 Result and Discussion
Expand All @@ -75,7 +97,6 @@ The code for download in server part: line 1243-1286




# 4.0 Page 2: 'Step 2: Generate Descriptors'

The relevant code for this page is as follows:
Expand All @@ -88,10 +109,22 @@ The code for output in server part: line 942-952, 966-990

## 4.1 Data, Code, and Resources

Here is a list data sets, codes, that are used in CTBS.

1. liux30_assignment07.Rmd (with knit pdf and html) is this notebook.
[https://github.rpi.edu/DataINCITE/DAR-CTEval-F24/blob/main/StudentNotebooks/Assignment07/liux30_assignment07.Rmd](https://github.rpi.edu/DataINCITE/DAR-CTEval-F24/blob/main/StudentNotebooks/Assignment07/liux30_assignment07.Rmd)


## 4.2 Contribution

This page is completed by Xiheng Liu and Tianyan Lin.

## 4.3 Methods Description

For Submit button, we have zero-shot and Three-shot.

For Three-shot function, we should take three trials as example, so I selected the example rows and target row for the ids we want. Then save all the elements for defferent columns to build the user propmt.

## 4.4 Result and Discussion

## 4.5 Conclusions, Limitations, and Future Work.
Expand All @@ -111,10 +144,21 @@ The code for downlaod in server part: line 1288-1317

## 5.1 Data, Code, and Resources

Here is a list data sets, codes, that are used in CTBS.

1. liux30_assignment07.Rmd (with knit pdf and html) is this notebook.
[https://github.rpi.edu/DataINCITE/DAR-CTEval-F24/blob/main/StudentNotebooks/Assignment07/liux30_assignment07.Rmd](https://github.rpi.edu/DataINCITE/DAR-CTEval-F24/blob/main/StudentNotebooks/Assignment07/liux30_assignment07.Rmd)


## 5.2 Contribution

This page is completed by Samuel Park and Xiheng Liu.

## 5.3 Methods Description

For Evaluation function, we should get all elemens in input textboxs, and also get the ActualFeatures and CandidateFeatures. The ActualFeatures is the Paper_BaselineMeasures_Corrected in CT_Pub_updated.df, and we save it into input box. After run load button, we get the result, and we can use regular expression to get the content between the first "]" and the first "*", which is CandidateFeatures. Then also save to input box. I build the user propmt bases on all the element in input boxes.


## 5.4 Result and Discussion

## 5.5 Conclusions, Limitations, and Future Work.
Expand Down
Binary file modified StudentNotebooks/Assignment07/liux30_assignment07.pdf
Binary file not shown.