{% extends "layouts/base.html" %} {% load i18n %} {% block title %}{% trans "Analyze Text" %}{% endblock %} {% block content %}

{% trans "Analyze Text" %}

{% trans "Perform sentiment analysis on any text" %}

{% trans "Back to List" %}
{% trans "Text Input" %}
{% csrf_token %}
{{ form.text }} {% if form.text.help_text %}
{{ form.text.help_text }}
{% endif %} {% if form.text.errors %}
{{ form.text.errors }}
{% endif %}
{{ form.language }} {% if form.language.help_text %}
{{ form.language.help_text }}
{% endif %}
{{ form.extract_keywords }}
{{ form.extract_entities }}
{{ form.detect_emotions }}
{% if result %}
{% trans "Analysis Results" %}
{% if result.sentiment == 'positive' %}

😊

{% trans "Positive" %}

{% elif result.sentiment == 'negative' %}

😞

{% trans "Negative" %}

{% else %}

😐

{% trans "Neutral" %}

{% endif %}
{% trans "Score" %}

{{ result.sentiment_score|floatformat:4 }}

(-1 to +1)
{% trans "Confidence" %}

{{ result.confidence|floatformat:2 }}

{% trans "Language" %}: {% if result.language == 'ar' %} العربية {% else %} English {% endif %}
{% if result.keywords %}
{% trans "Keywords" %}:
{% for keyword in result.keywords %} {{ keyword }} {% endfor %}
{% endif %} {% if result.entities %}
{% trans "Entities" %}:
    {% for entity in result.entities %}
  • {{ entity.type }} {{ entity.text }}
  • {% endfor %}
{% endif %} {% if result.emotions %}
{% trans "Emotions" %}: {% for emotion, score in result.emotions.items %} {% if score > 0 %}
{{ emotion }} {{ score|floatformat:2 }}
{% endif %} {% endfor %}
{% endif %}
{% trans "AI Service" %}: {{ result.ai_service }}
{% trans "Model" %}: {{ result.ai_model }}
{% trans "Processing Time" %}: {{ result.processing_time_ms }} ms
{% else %}

{% trans "Enter text and click Analyze to see results" %}

{% endif %}
{% endblock %}