OsBaran commited on
Commit
31613b6
1 Parent(s): 67cde5c

Add application

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -171,11 +171,15 @@ def trModelPredictAlgo(input_news):
171
  # En yüksek olasılığı ve sınıfı bulma
172
  predicted_class = torch.argmax(probabilities, dim=-1)
173
  predicted_probability = probabilities[0, predicted_class].item()
174
-
 
 
 
 
175
  # Sonucu yazdırma
176
  print(f"Predicted class: {predicted_class.item()}")
177
  print(f"Prediction probability: {predicted_probability * 100:.2f}%")
178
- return f"Predicted class: {predicted_class.item()}" + f"Prediction probability: {predicted_probability * 100:.2f}%"
179
  def enModelPredictAlgo(input_news):
180
  keywords = extract_keywords_keybert(input_news)
181
  search_query = ' '.join(keywords)
 
171
  # En yüksek olasılığı ve sınıfı bulma
172
  predicted_class = torch.argmax(probabilities, dim=-1)
173
  predicted_probability = probabilities[0, predicted_class].item()
174
+ sonuc = 0
175
+ if(predicted_class.item()==0):
176
+ sonuc = "Yanlış"
177
+ else :
178
+ sonuc = "Doğru"
179
  # Sonucu yazdırma
180
  print(f"Predicted class: {predicted_class.item()}")
181
  print(f"Prediction probability: {predicted_probability * 100:.2f}%")
182
+ return f"Dogruluk tahmini: {sonuc}" + f"Tahmin olasılığı: {predicted_probability * 100:.2f}%"
183
  def enModelPredictAlgo(input_news):
184
  keywords = extract_keywords_keybert(input_news)
185
  search_query = ' '.join(keywords)