Assignment of beyond codes
This program retrieves the data from the paginated API and the checks it’s citation and returns the valid citation based on the response text and source information.
- Fetch the data from the pages of the API above.
- Identifies citations based on similarity between response text and source context using a threshold.
- List down the sources from which the response was formed. Returns an empty array if the response did not come from any source. The shortlisted sources will be called citations
- Return the citations for all objects coming from the API.
- Prints identified citations in JSON format and a user-friendly table.
• Python 3.10 or above
• requests library (pip install requests)
• install the required libraries
• save the code as name.py(eg. Citation.py)
• run the file in cmd as python name.py