Skip to content

Conversation

kleeena
Copy link
Contributor

@kleeena kleeena commented Aug 1, 2025

This PR updates the code example in docs/examples/medication_examples.md to clarify how the output_dir parameter affects where the output file is saved when using lx.io.save_annotated_documents.

What's Changed

  • Explicitly sets output_dir="." in the example to ensure the file is saved in the current working directory.
  • Adds comments and a note explaining that the default value of output_dir is test_output/, which may not match user expectations.

Why This Matters

The previous example could confuse users, as it implied that setting output_name alone controls the full file path. In practice, the file is saved to the test_output/ directory by default. This clarification improves usability and prevents unnecessary debugging.

Related Issue

Fixes #8

☑️ I have signed the Google CLA.

Copy link
Collaborator

@aksg87 aksg87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kleeena,

Thanks for addressing this issue with the documentation. One suggestion - I think we can remove the inline comment since the output_dir="." is self-explanatory:

lx.io.save_annotated_documents(
    [result],
    output_name="medical_ner_extraction.jsonl",
    output_dir="."
)

Otherwise LGTM! Thanks for improving the documentation.

Deleted an inline comment referencing the  output directory in the save_annotated_documents.
@kleeena kleeena requested a review from aksg87 August 2, 2025 08:52
@aksg87 aksg87 merged commit 9472099 into google:main Aug 2, 2025
3 checks passed
aksg87 added a commit that referenced this pull request Aug 21, 2025
docs: clarify output_dir behavior in medication_examples.md
sinnaj referenced this pull request in sinnaj/langextract Sep 3, 2025
docs: clarify output_dir behavior in medication_examples.md
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.

Documentation: Incorrect usage of save_annotated_documents in medication_examples.md

2 participants