AI Risk Classification System: Day 6
Introduction
Today, I worked on creating a method to save the results and recommendations of the AI Risk Classification tool to a txt file.
Development Notes
First of all, I imported java.io.* to import the whole package. Then, I modified the main method to ask the user if they want to save the results to a file, and I call on fileResults to save the results to a txt file
In the fileResults method, I put everything in a try/catch block to catch any IOExceptions. I also ensured that the file name ends with “.txt” and I use fileWriter and BufferWriter for efficient file writing
Then, I simply reprint the results in this format:
- Header
- System details
- Classification results
- Risk category explainations
- Recommendations
- Disclaimer
I also ran a sample run to ensure that all the information is saved to “sample.txt” properly
Moving forward, I will work on the frontend to improve the UI/UX of the tool