Skip to content

Commit

Permalink
Merge pull request #44 from DARPA-ASKEM/3964-model-enrichment
Browse files Browse the repository at this point in the history
3964 model enrichment
  • Loading branch information
mwdchang authored Jul 11, 2024
2 parents 6728383 + ce4a56d commit bd2fe3b
Show file tree
Hide file tree
Showing 5 changed files with 3,335 additions and 5 deletions.
24 changes: 21 additions & 3 deletions gollm/openai/prompts/petrinet_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,33 @@
Return the different sets of initial parameters for the petri net model file like so:
{{"conditions": {{"condition_1": "description of condition_1", "condition_2": "description of condition_2", ...}},
"parameters": [{{
"id": "beta",
"value": {{'condition_1': 0.1, 'condition_2': 0.2}},
"id": "beta",
"name": "β",
"value": {{'condition_1': 0.1, 'condition_2': 0.2}},
"description": "infection rate",
"units": {{ "expression": "1/(person*day)", "expression_mathml": "<apply><divide/><cn>1</cn><apply><times/><ci>person</ci><ci>day</ci></apply></apply>" }}
"distribution": {{
"type": "Uniform1",
"parameters": {{
"minimum": 2.6e-7,
"maximum": 2.8e-7
}}
}},
....
}}
],
}}
If a condition is not mentioned in the following text body, then the value should be set to the string "null". Be sure to use consistent naming conventions for the conditions.
Instead of 'condition_1' and 'condition_2'.. use names that are descriptive of the conditions.
Only use parameters found in the reference petrinet file provided above.
For each parameter, following below instructions, fill the value for `name`, `description`, `units`, and `distribution` fields if not provided in the petrinet file.
- For the name, extract from the user provided text or derive it from the id whenever possible. Here are some examples of id to name mappings: {{ id: "beta", name: "β" }}, {{ id: "gamma", name: "γ" }}, {{ id: "S0", name: "S₀" }}, {{ id: "I0", name: "R₀" }}. If a name can't be generated, omit the field.
- For the description, provide long-form description of the parameter. If the description can not be found, set it to an empty string "",
- For units, provide both "units.expression" (a unicode string) and "units.expression_mathml" (MathML format). Ensure both units are valid and represent the same unit. If the unit is not found or not valid, omit the units field.
- For the distribution, if present, provide 'distribution.type' and 'distribution.parameters' using 'name' and 'parameters' from the following probability distribution ontology JSON. If a valid distribution is not found, omit the distribution field. Make sure following JSON content is only used for the distribution field and must not affect other fields. --START PROBABILITY DISTRIBUTION ONTOLOGY JSON-- {pb} --END PROBABILITY DISTRIBUTION ONTOLOGY JSON--
Only use parameters found in the reference petrinet file provided above.
Ensure that the output follows the above petri net format and can be serialized as a JSON. Specifically populate parameters and initials. Use the following
text body to answer the user's query: --START USER PROVIDED TEXT-- {research_paper}--END USER PROVIDED TEXT--\n\n Answer:
{{
Expand Down
Loading

0 comments on commit bd2fe3b

Please sign in to comment.