Skip to content

Peng task2#153

Merged
ColtonPayne merged 6 commits into
mainfrom
peng-task2
May 12, 2026
Merged

Peng task2#153
ColtonPayne merged 6 commits into
mainfrom
peng-task2

Conversation

@PengLin-Zilv
Copy link
Copy Markdown
Contributor

Summary

Implements task 2 as described in https://sumailsyr-my.sharepoint.com/:w:/g/personal/jpatil01_syr_edu/IQARlfe48KDiRrHCOmFnAYmHAV98Gnc9SjifRRNSky2_5zE?e=HC7FGk

Add a tutorial and example demonstrating how to convert natural language paragraphs into PyReason facts and rules using an open source local LLM.

Changes

  • New tutorial: docs/source/tutorials/natural_language_to_pyreason.rst
  • New example: examples/natural_language_to_pyreason_ex.py
  • Updated tutorial index to include the new tutorial

Pipeline

User input structured paragraph

  • Step 1: LLM extracts facts/rules from English paragraph
  • Step 2: LLM converts English to PyReason syntax
  • Step 3: Parser extracts structured facts/rules
  • Step 4: Validate each rule with pr.Rule()

Testing

Tested with different models, chose qwen3:14b for its speed and stability on four paragraphs spanning education, medical,
legal, animal, and relational (edge rule) scenarios. All pass rule validation.

Outputs: for different structured paragraphs, each tested 2+ times to ensure the stability

Test 1: study/school
image

Test 2: Medical
image

Test 3: Legal
image

Test 4: Animal
image

Test 5: Workforce Relational (Edge Rule)
image

Copy link
Copy Markdown
Collaborator

@ColtonPayne ColtonPayne left a comment

Choose a reason for hiding this comment

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

LGTM

@ColtonPayne ColtonPayne merged commit 43c51cf into main May 12, 2026
3 checks passed
@ColtonPayne ColtonPayne deleted the peng-task2 branch May 12, 2026 20:39
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.

2 participants