#K82972. Log Classification with Multinomial Naive Bayes

    ID: 36094 Type: Default 1000ms 256MiB

Log Classification with Multinomial Naive Bayes

Log Classification with Multinomial Naive Bayes

In this problem, you are given the contents of a log file as input. The log file contains several lines of text, where each log entry may correspond to one of three predefined categories: (\textbf{Network}), (\textbf{Server}), or (\textbf{Security}). Your task is to determine the correct category by analyzing the textual content of the log. The classification is based on keywords: if the log contains a phrase such as "Failed to establish a connection", it is classified as a (\textbf{Network}) issue; if it contains "500 Internal Server Error", it is classified as a (\textbf{Server}) issue; and if it contains "Unauthorized access attempt", it is classified as a (\textbf{Security}) issue.

inputFormat

The input is provided via standard input (stdin) and consists of a multi-line log message. All the lines together form a single log, which needs to be classified into one of the three categories.

outputFormat

Output a single line via standard output (stdout) containing the predicted log category. The output should be one of the following strings: (\textbf{Network}), (\textbf{Server}), or (\textbf{Security}).## sample

987654
Failed to establish a connection
The server did not respond in time, resulting in a timeout. Ensure the server is reachable and that there are no firewall issues preventing communication.
Network