Cyberjusticelab / JusticeAI

JusticeAI (ProceZeus) is a web chat bot that aims to facilitate access to judicial proceedings involving Quebec tenant/landlord law
https://cyberjusticelab.github.io/JusticeAI/docs/rendered/
MIT License
21 stars 16 forks source link

Similarity claim table #370

Closed arekmano closed 6 years ago

arekmano commented 6 years ago

Description As a user, I would like the system to display a table comparing the 5 most similar claims to my current one

Scope of Work

Demo requirement and Acceptance Criteria

  1. After a prediction, the user is able to see a table of similar cases and the fact values of these cases.
arekmano commented 6 years ago

Initial mockup, drawn during the meeting: img_20180302_185203

arekmano commented 6 years ago

Proposed API change to ML Service /predict endpoint

OLD

{
    "outcomes_vector": {
      "orders_resiliation" : 1,
      ...
    },
    "similar_precedents" : [
        {
            "precedent": "AZ-1111111",
            "distance": 1.23123
        },
        {
            "precedent": "AZ-2222222",
            "distance": 1.23123
        },
        {
            "precedent": "AZ-3333333",
            "distance": 1.23123
        }
    ]
}

NEW

{
    "outcomes_vector": {
      "orders_resiliation" : 1,
      ...
    },
    "similar_precedents" : [
        {
            "precedent": "AZ-1111111",
            "distance": 1.23123,
            "facts": {
                "absent" : 1,
                "apartment_impropre" : 0,
                "apartment_infestation" : 1,
                "asker_is_landlord" : 1,
                "asker_is_tenant" : 1,
                "bothers_others" : 1,
                "disrespect_previous_judgement" : 1
            },
            "outcomes": {
                "absent" : 1,
                "apartment_impropre" : 0,
                "apartment_infestation" : 1,
                "asker_is_landlord" : 1,
                "asker_is_tenant" : 1,
                "bothers_others" : 1,
                "disrespect_previous_judgement" : 1
            }
        },
        {
            "precedent": "AZ-2222222",
            "distance": 1.23123,
            "facts": {
                "absent" : 1,
                "apartment_impropre" : 0,
                "apartment_infestation" : 1,
                "asker_is_landlord" : 1,
                "asker_is_tenant" : 1,
                "bothers_others" : 1,
                "disrespect_previous_judgement" : 1
            },
            "outcomes": {
                "absent" : 1,
                "apartment_impropre" : 0,
                "apartment_infestation" : 1,
                "asker_is_landlord" : 1,
                "asker_is_tenant" : 1,
                "bothers_others" : 1,
                "disrespect_previous_judgement" : 1
            }
        },
        {
            "precedent": "AZ-3333333",
            "distance": 1.23123,
            "facts": {
                "absent" : 1,
                "apartment_impropre" : 0,
                "apartment_infestation" : 1,
                "asker_is_landlord" : 1,
                "asker_is_tenant" : 1,
                "bothers_others" : 1,
                "disrespect_previous_judgement" : 1
            },
            "outcomes": {
                "absent" : 1,
                "apartment_impropre" : 0,
                "apartment_infestation" : 1,
                "asker_is_landlord" : 1,
                "asker_is_tenant" : 1,
                "bothers_others" : 1,
                "disrespect_previous_judgement" : 1
            }
        }
    ]
}
naregeff commented 6 years ago

Works and beautiful 👍

New story: add strings + transpose table.