Skip to content

Conversation

@DHANUSHRAJA22
Copy link
Contributor

@DHANUSHRAJA22 DHANUSHRAJA22 commented Aug 26, 2025

Description

This PR adds a comprehensive demonstration of Harmony's new user-defined topics feature to the Harmony walkthrough notebook. The demo shows how researchers can specify custom topic categories for automatic tagging of survey instruments and questions, providing greater flexibility and domain-specific categorization beyond the standard predefined topics.

Key Features Added:

  • Complete demo section showcasing user-defined topics functionality
  • Practical code examples with custom mental health topic categories
  • Detailed rationale explaining the benefits of custom taxonomies
  • Integration with existing Harmony workflows
  • Clear documentation for maintainers and users

Fixes #105 - User-defined topic categories

Related to PR #104 - Add user-defined topics functionality

Type of change

  • New feature (non-breaking change which adds functionality)
  • Requires a documentation revision

Testing

The demo code has been added to the notebook and follows the established patterns of the existing walkthrough. The feature demonstrates:

  • Loading sample instruments
  • Defining custom topics for mental health research domain
  • Applying user-defined topics to instruments
  • Displaying results in a user-friendly format

Checklist

  • My PR is for one issue, rather than for multiple unrelated fixes
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings
  • If I introduced a new feature, I documented it (this demo serves as documentation for users)

Description

This PR adds a comprehensive demonstration of Harmony's new user-defined topics feature to the Harmony walkthrough notebook. The demo shows how researchers can specify custom topic categories for automatic tagging of survey instruments and questions, providing greater flexibility and domain-specific categorization beyond the standard predefined topics.

Key Features Added:

  • Complete demo section showcasing user-defined topics functionality
  • Practical code examples with custom mental health topic categories
  • Detailed rationale explaining the benefits of custom taxonomies
  • Integration with existing Harmony workflows
  • Clear documentation for maintainers and users

Fixes #105 - User-defined topic categories

Related to PR #104 - Add user-defined topics functionality

Type of change

  • New feature (non-breaking change which adds functionality)
  • Requires a documentation revision

Testing

The demo code has been added to the notebook and follows the established patterns of the existing walkthrough. The feature demonstrates:

  • Loading sample instruments
  • Defining custom topics for mental health research domain
  • Applying user-defined topics to instruments
  • Displaying results in a user-friendly format

Checklist

  • My PR is for one issue, rather than for multiple unrelated fixes
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings
  • If I introduced a new feature, I documented it (this demo serves as documentation for users)

Please review this addition to help users understand and utilize the new user-defined topics functionality introduced in Issue #105 and implemented in PR #104.****Please review this addition to help users understand and utilize the new user-defined topics functionality introduced in Issue #105 and implemented in PR #104.## Description

Please include a summary of the change and which issue is fixed. Please also include relevant context. List any dependencies that are required for this change. Ideally we avoid introducing any new third party dependencies in requirements.txt and pyproject.toml unless absolutely necessary, because this makes the project more susceptible to breaking whenever a third party library is updated.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Requires a documentation revision

Testing

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Since the Harmony Python package is used by the Harmony API (which is itself used by the R library and the web app), we need to avoid making any changes that break the Harmony API. Please also run the Harmony API unit tests and check that the API still runs with your changes to the Python package: https://github.com/harmonydata/harmonyapi

Test Configuration

  • Library version:
  • OS:
  • Toolchain:

Checklist

  • My PR is for one issue, rather than for multiple unrelated fixes.
  • My code follows the style guidelines of this project. I have applied a Linter (recommended: Pycharm's code formatter) to make my whitespace consistent with the rest of the project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • The Harmony API is not broken by my change to the Harmony Python library
  • I add third party dependencies only when necessary. If I changed the requirements, it changes in requirements.txt, pyproject.toml and also in the requirements.txt in the API repo
  • If I introduced a new feature, I documented it (e.g. making a script example in the script examples repository so that people will know how to use it.

Optionally: feel free to paste your Discord username in this format: discordapp.com/users/yourID in your pull request description, then we can know to tag you in the Harmony Discord server when we announce the PR.

…cs demo section to notebookUpdate Harmony_example_walkthrough.ipynb

Added new markdown cell showcasing the user-defined topics feature introduced in v1.0.5. Includes rationale, benefits, and references to Issue harmonydata#105 and PR harmonydata#104 for maintainer context. This enhancement demonstrates the custom topic categorization capabilities for domain-specific research needs.
…mple_walkthrough.ipynb

Added a hands-on code cell immediately after the user-defined topics demo section. The code demonstrates:

- Setting up custom topics list for mental health research
- Calling harmony.match_instruments with topics parameter
- Displaying each question with detected topics using clear variable names
- Includes minimal inline comments for code clarity

This practical example helps users understand how to implement the new user-defined topics feature introduced in v1.0.5.
@jaydugad jaydugad merged commit 7f9324a into harmonydata:main Aug 26, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add used defined topics to Jupyter walkthrough

2 participants