Sentiments-of-Bundestag / frontend_sentiment

Frontend for Sentiments of Bundestag
http://infosys7.f4.htw-berlin.de
0 stars 0 forks source link

Check if Endpoints provided by Group 7 are sufficient. #1

Open MariamaB opened 3 years ago

MariamaB commented 3 years ago

Hey @abteilung6, @OliKue Please check if the endpoints that we are providing you so far are sufficient and let us know if you want us to add anything.

https://github.com/Sentiments-of-Bundestag/graphenauswertung/blob/develop/README.md#endpoints

steven-mi commented 3 years ago

Could you write a more detailed documentation of your endpoints? Just define once what you return e.g. is it a JSON, XML, Text?

abteilung6 commented 3 years ago

At least add some responses to your endponts. So that we dont need to explorer your interfaces. Is there any demo available? We wont host your project.

glutengo commented 3 years ago

Sorry, for the (very) limited amount of documentation we have provided so far.

Our application runs on http://infosys6.f4.htw-berlin.de/

The Endpoints are available here: http://infosys6.f4.htw-berlin.de/persons http://infosys6.f4.htw-berlin.de/persons/ranked http://infosys6.f4.htw-berlin.de/persons/messages http://infosys6.f4.htw-berlin.de/persons/graph http://infosys6.f4.htw-berlin.de/factions http://infosys6.f4.htw-berlin.de/factions/graph

The data will definitely stay in JSON format.

Our suggestion would be that you inspect the data which is returned at the moment and we define which attributes or filters are missing.

We will provide a more detailed documentation (with swagger or similar) once it is more stable.

steven-mi commented 3 years ago

@glutengo Where will be the time information stored? What about the fraction of a person?

glutengo commented 3 years ago

What exactly do you mean by time information? We can provide endpoints for the available parliament sessions and add query parameters to the other endpoints which filter the data by a selected parliament session. Is that what you are looking for?

We can add the faction attribute to the person.

steven-mi commented 3 years ago

What exactly do you mean by time information? We can provide endpoints for the available parliament sessions and add query parameters to the other endpoints which filter the data by a selected parliament session. Is that what you are looking for?

Yes. I believe the sentiments are calculated on a session-by-session basis. Is this true or are they averaged over all sessions?

We can add the faction attribute to the person.

:+1:

glutengo commented 3 years ago

They are averaged over all sessions, but we only have data for one session for now so it is basically the same at the moment. We will add an endpoint for the sessions and a filter to the person-based endpoints so each of them can be filtered by a parliament session.

examples:
http://infosys6.f4.htw-berlin.de/persons/graph returns the graph over all parliament sessions
http://infosys6.f4.htw-berlin.de/persons/graph?session=<THE_SESSION_ID> returns the graph for the given session

http://infosys6.f4.htw-berlin.de/persons/ranked returns the ranked persons over all parliament sessions http://infosys6.f4.htw-berlin.de/persons/ranked?session=<THE_SESSION_ID> returns the ranked persons for the given session

This has not been implemented yet but will be added in the next week.

In the meantime, we have added a new endpoint for the pagerank of the factions: http://infosys6.f4.htw-berlin.de/factions/ranked

...and added the faction attribute to the persons: http://infosys6.f4.htw-berlin.de/persons/

glutengo commented 3 years ago

We have also added a filterquery parameter to the ranked endpoints which can be used to calculate the page rank based on messages with POSITIVE or NEGATIVE sentiment only.

Usage:
http://infosys6.f4.htw-berlin.de/persons/ranked returns the ranked persons based on all messages http://infosys6.f4.htw-berlin.de/persons/ranked?filter=NEGATIVE returns the ranked persons based on messages with negative sentiment http://infosys6.f4.htw-berlin.de/persons/ranked?filter=POSITIVE returns the ranked persons based on messages with positive sentiment

http://infosys6.f4.htw-berlin.de/factions/ranked returns the ranked factions based on all messages http://infosys6.f4.htw-berlin.de/factions/ranked?filter=NEGATIVE returns the ranked factions based on messages with negative sentiment http://infosys6.f4.htw-berlin.de/factions/ranked?filter=POSITIVE returns the ranked factions based on messages with positive sentiment

abteilung6 commented 3 years ago

@glutengo Thanks for your impressiv report. Since now your endpoints are working fine.

Our current problem is the missing time dimension, which makes it difficult to design our components and interfaces.

Additionally we would prefer a generated ID for each Object (Factions)

King Regards, Tilman

glutengo commented 3 years ago

OK. As mentioned we currently only receive data for one session from the preceeding groups and that is why we did not implement any session distinction yet. We will start with this as our next task and I will ask for data from more sessions in the plenum tomorrow.

steven-mi commented 3 years ago

I see. Thanks a lot for your help!

What is the difference between the ranked and sentiment endpoint? I know that you are using page rank but can you elaborate on the meaning behind the values for the entrypoints?

glutengo commented 3 years ago

Maybe we can find a few minutes to talk about this tomorrow so we can discuss this in detail?

Generally speaking, the sentiment is always connected to a relation between two nodes (persons or factions). So this describes the attitude of the sender towards the receiver. The (page)rank however is connected to a node and describes the importance of this node compared to the other nodes in the graph. The rank values in a graph add up to a total of 1.0. If the ranked endpoints are filtered, the rank may be interpreted as an indicator for being a mood buster (Stimmungsmacher, positive) or a troublemaker (Unruhestifter, negative - not sure if this is the best term for this)

glutengo commented 3 years ago

This is the planned spec for the /sessions endpoint and the filter options for the other endpoints:

https://github.com/Sentiments-of-Bundestag/graphenauswertung/tree/feature/filter-by-session#endpoints

I have added descriptions for the newly introduced query parameters and added some sample data. This has not been deployed yet, so it is only a pre-information notice so you can make preparations on your end. Group5 does not yet have the factionId on the faction nodes in their database yet but I have asked them to add it.

glutengo commented 3 years ago

We have now deployed the version of the app with the described endpoints. We have additionally added the factionId to the person nodes as requested in https://github.com/Sentiments-of-Bundestag/graphenauswertung/issues/23