clinical-trials / README.md
louisbrulenaudet's picture
Update README.md
67359a8 verified
---
dataset_info:
features:
- name: nct_id
dtype: string
- name: updated_at
dtype: timestamp[us]
- name: brief_title
dtype: string
- name: official_title
dtype: string
- name: acronym
dtype: string
- name: study_type
dtype: string
- name: overall_status
dtype: string
- name: study_first_submit_date
dtype: timestamp[ms]
- name: start_date
dtype: timestamp[ms]
- name: primary_completion_date
dtype: timestamp[ms]
- name: completion_date
dtype: timestamp[ms]
- name: phases
sequence: string
- name: enrollment_count
dtype: float64
- name: minimum_age
dtype: float64
- name: maximum_age
dtype: float64
- name: sex
dtype: string
- name: healthy_volunteers
dtype: bool
- name: brief_summary
dtype: string
- name: detailed_description
dtype: string
- name: eligibility_criteria
dtype: string
- name: lead_sponsor_name
dtype: string
- name: lead_sponsor_class
dtype: string
- name: org_study_id_info
struct:
- name: id
dtype: string
- name: link
dtype: string
- name: type
dtype: string
- name: why_stopped
dtype: string
- name: expanded_access_info
struct:
- name: hasExpandedAccess
dtype: bool
- name: nctId
dtype: string
- name: statusForNctId
dtype: string
- name: last_update_submit_qc_date
dtype: timestamp[ms]
- name: last_update_post_date_struct
struct:
- name: date
dtype: string
- name: type
dtype: string
- name: study_first_post_date_struct
struct:
- name: date
dtype: string
- name: type
dtype: string
- name: std_ages
sequence: string
- name: study_population
dtype: string
- name: sampling_method
dtype: string
- name: oversight_has_dmc
dtype: bool
- name: design_info
struct:
- name: allocation
dtype: string
- name: interventionModel
dtype: string
- name: interventionModelDescription
dtype: string
- name: maskingInfo
struct:
- name: masking
dtype: string
- name: maskingDescription
dtype: string
- name: whoMasked
sequence: string
- name: observationalModel
dtype: string
- name: primaryPurpose
dtype: string
- name: timePerspective
dtype: string
- name: conditions
sequence: string
- name: keywords
dtype: string
- name: interventions
dtype: 'null'
- name: locations
list:
- name: city
dtype: string
- name: country
dtype: string
- name: facility
dtype: string
- name: geoPoint
struct:
- name: lat
dtype: float64
- name: lon
dtype: float64
- name: state
dtype: string
- name: collaborators
list:
- name: class
dtype: string
- name: name
dtype: string
- name: arm_groups
dtype: 'null'
- name: outcomes
struct:
- name: other
list:
- name: description
dtype: 'null'
- name: measure
dtype: string
- name: timeFrame
dtype: string
- name: primary
list:
- name: description
dtype: 'null'
- name: measure
dtype: string
- name: timeFrame
dtype: string
- name: secondary
list:
- name: description
dtype: 'null'
- name: measure
dtype: string
- name: timeFrame
dtype: string
- name: overall_officials
list:
- name: affiliation
dtype: string
- name: name
dtype: string
- name: role
dtype: string
- name: study_references
dtype: string
- name: misc_info_module
dtype: string
- name: condition_browse_module
struct:
- name: ancestors
list:
- name: id
dtype: string
- name: term
dtype: string
- name: browseBranches
list:
- name: abbrev
dtype: string
- name: name
dtype: string
- name: browseLeaves
list:
- name: asFound
dtype: string
- name: id
dtype: string
- name: name
dtype: string
- name: relevance
dtype: string
- name: meshes
list:
- name: id
dtype: string
- name: term
dtype: string
- name: intervention_browse_module
struct:
- name: ancestors
list:
- name: id
dtype: string
- name: term
dtype: string
- name: browseBranches
list:
- name: abbrev
dtype: string
- name: name
dtype: string
- name: browseLeaves
list:
- name: asFound
dtype: string
- name: id
dtype: string
- name: name
dtype: string
- name: relevance
dtype: string
- name: meshes
list:
- name: id
dtype: string
- name: term
dtype: string
- name: mesh_terms
struct:
- name: conditions
list:
- name: id
dtype: string
- name: term
dtype: string
- name: interventions
list:
- name: id
dtype: string
- name: term
dtype: string
splits:
- name: train
num_bytes: 3939617129
num_examples: 541897
download_size: 1773167837
dataset_size: 3939617129
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
license: apache-2.0
task_categories:
- question-answering
- feature-extraction
- text-classification
language:
- en
- fr
- es
tags:
- biology
- medical
- clinical
- trials
- scien
pretty_name: Clinical trials dataset
size_categories:
- 100K<n<1M
---
# Clinical Trials Dataset
A comprehensive dataset of clinical trials sourced from ClinicalTrials.gov, featuring structured metadata, detailed study information, and pre-computed semantic embeddings for machine learning applications in biomedical research.
## Dataset Description
This dataset provides a rich collection of clinical trial information systematically collected from the official ClinicalTrials.gov database. Each record contains detailed study metadata, eligibility criteria, intervention descriptions, outcome measures, and organizational information. The dataset is enhanced with semantic embeddings generated using specialized biomedical language models, making it immediately ready for downstream ML tasks.
### Key Features
- **Comprehensive Coverage**: Complete clinical trial records with 30+ structured fields
- **Rich Metadata**: Study phases, enrollment data, eligibility criteria, and outcome measures
- **Temporal Data**: Complete timeline information from submission to completion
- **Medical Ontology**: MeSH terms and condition/intervention classifications
## Dataset Statistics
| Metric | Value |
|--------|-------|
| Total Studies | 500,000+ |
| Data Source | ClinicalTrials.gov Official API |
| Languages | English |
## Data Collection Methodology
The dataset is built using a robust data pipeline that ensures data quality and consistency:
1. **API Integration**: Direct connection to ClinicalTrials.gov API v2
3. **Data Validation**: Pydantic models ensure schema compliance and data integrity
4. **Type Conversion**: Automatic parsing of dates, numbers, and JSON structures
5. **Embedding Generation**: Semantic embeddings computed using domain-specific models
### Data Quality Assurance
- **Schema Validation**: All records validated against comprehensive Pydantic models
- **Type Safety**: Proper data type conversion with null handling
- **Deduplication**: Unique constraint on NCT ID prevents duplicates
- **Temporal Consistency**: Date validation and chronological ordering
- **Text Normalization**: Whitespace cleanup and encoding standardization
## Schema Overview
### Core Study Information
- `nct_id`: Unique study identifier (NCT########)
- `brief_title`: Concise study title
- `official_title`: Complete formal study title
- `study_type`: Study design type (Interventional, Observational, etc.)
- `phases`: Clinical trial phases (Phase I, II, III, IV)
- `overall_status`: Current study status
### Study Design & Population
- `enrollment_count`: Target or actual enrollment number
- `minimum_age` / `maximum_age`: Age eligibility bounds
- `sex`: Gender eligibility (All, Male, Female)
- `healthy_volunteers`: Whether healthy volunteers accepted
- `eligibility_criteria`: Detailed inclusion/exclusion criteria
- `study_population`: Target population description
### Clinical Context
- `conditions`: Medical conditions studied
- `keywords`: Study-related keywords
- `brief_summary`: Study purpose and rationale
- `detailed_description`: Comprehensive study description
- `primary_outcomes` / `secondary_outcomes`: Measured endpoints
### Organizational Information
- `lead_sponsor`: Primary study sponsor
- `collaborators`: Additional supporting organizations
- `locations`: Study sites with geographic coordinates
- `overall_officials`: Principal investigators and study officials
### Temporal Data
- `study_first_submit_date`: Initial submission to ClinicalTrials.gov
- `start_date`: Study start date
- `primary_completion_date`: Primary endpoint completion
- `completion_date`: Overall study completion
- `last_update_submit_date`: Most recent data update
### Enhanced Features
- `brief_summary_embedding`: 768-dim semantic embedding of study summary
- `eligibility_criteria_embedding`: 768-dim embedding of eligibility text
## Usage Examples
### Basic Data Loading
```python
from datasets import load_dataset
# Load the complete dataset
dataset = load_dataset("louisbrulenaudet/clinical-trials")
# Access train split
train_data = dataset["train"]
print(f"Dataset size: {len(train_data)}")
print(f"Features: {train_data.features}")
```
### Advanced usage and embeddings
```python
from datasets import load_dataset
from sentence_transformers import SentenceTransformer
model = SentenceTransformer(
"thomas-sounack/BioClinical-ModernBERT-base", device="cuda", model_kwargs={"torch_dtype": "float16"}
)
dataset = load_dataset("louisbrulenaudet/clinical-trials", split="train")
columns_to_embed = [
"brief_summary",
"eligibility_criteria"
]
def embed_texts(batch):
for col in columns_to_embed:
embeddings = model.encode(batch[col], convert_to_numpy=True, normalize_embeddings=True)
batch[f"{col}_embedding"] = embeddings.tolist()
return batch
embedded_dataset = hf_dataset.map(
embed_texts,
batched=True,
batch_size=512,
desc="Embedding columns"
)
```
## Applications
This dataset enables various research and development applications:
### Clinical Research
- **Study Landscape Analysis**: Understanding research trends and gaps
- **Protocol Optimization**: Learning from successful study designs
- **Site Selection**: Geographic analysis for multi-center trials
- **Regulatory Intelligence**: Phase progression and approval patterns
### Machine Learning
- **Text Classification**: Categorizing studies by therapeutic area
- **Information Extraction**: Parsing eligibility criteria and outcomes
- **Similarity Search**: Finding related studies using embeddings
- **Trend Prediction**: Forecasting research directions
### Healthcare Analytics
- **Disease Burden Analysis**: Understanding research investment by condition
- **Innovation Tracking**: Monitoring emerging therapies and interventions
- **Collaboration Networks**: Analyzing sponsor and investigator relationships
- **Geographic Health Mapping**: Regional research activity patterns
## Data Limitations & Considerations
### Coverage Limitations
- **Source Dependency**: Limited to studies registered on ClinicalTrials.gov
- **Registration Bias**: Not all studies worldwide are required to register
- **Temporal Scope**: Historical data quality varies by submission period
- **Language**: Primarily English-language studies
### Data Quality Notes
- **Self-Reported**: Information accuracy depends on sponsor reporting
- **Update Lag**: Some studies may have outdated status information
- **Completeness**: Optional fields may be sparse for older studies
- **Standardization**: Free-text fields may lack consistent formatting
### Ethical Considerations
- **Privacy**: No individual participant data included
- **Transparency**: Enhances clinical research transparency
- **Research Bias**: May reflect existing healthcare disparities
- **Access**: Promotes equitable access to clinical research information
## Licensing & Attribution
### Dataset License
This dataset is released under the MIT License, allowing for both academic and commercial use with proper attribution.
### Source Attribution
- **Primary Source**: ClinicalTrials.gov (https://clinicaltrials.gov/)
- **API**: ClinicalTrials.gov API v2
### Citation
If you use this dataset in your research, please cite:
```bibtex
@dataset{louisbrulenaudet2025,
title={Clinical Trials Dataset: Comprehensive ClinicalTrials.gov Data for Semantic analysis},
author={[Louis Brulé Naudet]},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/datasets/louisbrulenaudet/clinical-trials}
}
```
*This dataset aims to accelerate biomedical research by providing easy access to comprehensive clinical trial information. We encourage responsible use that advances medical knowledge and improves patient outcomes.*
## Feedback
If you have any feedback, please reach out at [[email protected]](mailto:[email protected]).