To make sure we join up, it would help to agree what the inputs and outputs of our main functions/components are so that we don't tightly couple things.
A starter for ten is:
[Optional extra - 'Newspaper fetcher' takes no input and returns a list of available newspapers. User chooses one for the next step's input. To start with we can hardcode in the newspaper name.]
'News headline fetcher' - input is a newspaper name as a string. Output is an array of strings containing headlines (possible concatenated with descriptions if it helps the analysis).
'Headline analyser' - takes array of strings to be analysed. Returns a single object in the form of {sport: 2, business: 0.8}, summarising the topic relevance of all input strings.
'Infographic builder' - takes object of topic: value and produces markup for some kind of infographic.
Note that the main problem with the above structure is that we don't link the analysis output to the individual headlines, so we get the overall result for all headlines but we can't dive into each headline and show its score. I don't think this is material for our project, personally. An alternative would be to store each headline as an object and add a 'topics' property to each one once we've done the analysis.
To make sure we join up, it would help to agree what the inputs and outputs of our main functions/components are so that we don't tightly couple things.
A starter for ten is:
[Optional extra - 'Newspaper fetcher' takes no input and returns a list of available newspapers. User chooses one for the next step's input. To start with we can hardcode in the newspaper name.]
'News headline fetcher' - input is a newspaper name as a string. Output is an array of strings containing headlines (possible concatenated with descriptions if it helps the analysis).
'Headline analyser' - takes array of strings to be analysed. Returns a single object in the form of
{sport: 2, business: 0.8}
, summarising the topic relevance of all input strings.'Infographic builder' - takes object of
topic: value
and produces markup for some kind of infographic.Note that the main problem with the above structure is that we don't link the analysis output to the individual headlines, so we get the overall result for all headlines but we can't dive into each headline and show its score. I don't think this is material for our project, personally. An alternative would be to store each headline as an object and add a 'topics' property to each one once we've done the analysis.