Design #240
openJSON layout of logic gate values
0%
Description
This is mostly a question...
Currently the layout of saved rule form RuleMaker has each Input Condition sentence laid out like this :
[ { "sentence":[ { "determiner":: "The" }, { "noun": "capacity" }, { "description": "of this box" }, { "past_participle_verb": "used" }, { "predicate_verb": "is" }, { "attribute": ">=half" } ], "scenarios": [ "00", "01", "01" } << This should be a square bracket },
Yesterday I did some experiments with an LLM, and it gave me the JSON layout as follows, which is easier to read (both the sentence elements and the rows of numeric values). Furthermore, I notice an erroneous closing curley bracked } in ours after the scenarios, which is supposed to be a closing square bracket ]. I point at it above.
[ { "sentence": [ {"determiner": "The"}, {"noun": "capacity"}, {"description": "of this box"}, {"past_participle_verb": "used"}, {"predicate_verb": "is"}, {"attribute": ">=half"} ], "scenarios": ["00", "01", "01"] },
Please revise the layout. Other than fixing the } to ], I don't think any of this will affect the API.
Files
Updated by Joseph Potvin 11 months ago
- File Rules-As-Data-example_Potvin-revised_pp198-202.pdf Rules-As-Data-example_Potvin-revised_pp198-202.pdf added
See Table 26 in the attached PDF -- a revised table in my thesis. This arrangement is so much easier to look at, with nothing lost for computability.
Updated by Joseph Potvin 11 months ago
Here is an improvement on the layout style I requested, which is also more consistent with the rest of the output:
{
"sentence": [
{
"determiner": "The",
"past_participle_verb": "advertized",
"noun": "price",
"description": "of the delivery service",
"predicate_verb": "is",
"attribute": "charged"
}
]
}
Updated by Joseph Potvin 11 months ago
I reconsidered the horizontal layout: "scenarios": ["00", "01", "01"]
I realized that will be difficult to audit for large rules, so please leave this segment as it is:
"scenarios": { "A": "00", "B": "01", "C": "01" }
We might adjust this segment in the later optimization.
However we should still reformat the sentences as indicated above https://xalgorithms.redminepro.net/issues/240#note-2
Updated by Huda Hussain 9 months ago
Joseph Potvin wrote in #note-2:
Here is an improvement on the layout style I requested, which is also more consistent with the rest of the output:
{
"sentence": [
{
"determiner": "The",
"past_participle_verb": "advertized",
"noun": "price",
"description": "of the delivery service",
"predicate_verb": "is",
"attribute": "charged"
}
]
}
So the reason It is originally like this, is that I wanted to keep the order of the values in the dictionary, which would not be saved otherwise, if merged like this. For example
{
"sentence": [
{
"determiner": "The",
"past_participle_verb": "advertized",
"noun": "price",
"description": "of the delivery service",
"predicate_verb": "is",
"attribute": "charged"
}
]
}
and{
"sentence": [
{
"determiner": "The",
"noun": "price",
"predicate_verb": "is",
"past_participle_verb": "advertized",
"description": "of the delivery service",
"attribute": "charged"
}
]
}
Would be displayed the same way. Do you want to proceed with this change? IF you do, then everytime you load in a rule, you need to switch the values to the correct position.
Updated by Huda Hussain 9 months ago
- Assignee changed from Huda Hussain to Joseph Potvin
Updated by Joseph Potvin 7 months ago
- Status changed from New to Resolved
- Assignee changed from Joseph Potvin to Huda Hussain
Ah, I understand. Okay, then leave it "as is".
Dave Thomas has a relevant suggestion, which I'll document in a separate issue.