finalizare 1.0
This commit is contained in:
@@ -46,7 +46,6 @@ class DiseasePredictor:
|
||||
self.model.fit(self.X_train, self.y_train) # X_train is a DataFrame with feature names
|
||||
logging.info(f"Training accuracy: {self.model.score(self.X_test, self.y_test):.2f}")
|
||||
|
||||
|
||||
def extract_features(self, text):
|
||||
logging.info("Extracting features from text")
|
||||
|
||||
@@ -118,7 +117,7 @@ class DiseasePredictor:
|
||||
if count == 3:
|
||||
break
|
||||
# Return the JSON object
|
||||
return json.dumps(json_output, indent=4)
|
||||
return json.dumps(json_output)
|
||||
|
||||
|
||||
# Example usage:
|
||||
@@ -127,11 +126,11 @@ if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
logging.error("Incorrect number of arguments provided.")
|
||||
json_output = {
|
||||
"StatusCode": 400,
|
||||
"Message": "Incorrect number of arguments provided.",
|
||||
"Data": []
|
||||
}
|
||||
print(json.dumps(json_output, indent=4))
|
||||
"StatusCode": 400,
|
||||
"Message": "Incorrect number of arguments provided.",
|
||||
"Data": []
|
||||
}
|
||||
print(json.dumps(json_output))
|
||||
sys.exit(1)
|
||||
|
||||
logging.basicConfig(filename='disease_prediction.log', level=logging.INFO,
|
||||
|
||||
Reference in New Issue
Block a user