Spaces:
Sleeping
Sleeping
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
<title>NORUS Tool</title> | |
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}"> | |
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
<script src="{{ url_for('static', filename='js/script.js') }}"></script> | |
</head> | |
<body> | |
<header> | |
<div style="text-align: center; margin-top: 20px;"> | |
<a href="#" id="logo-link"> | |
<img id="logo" src="https://i.imgur.com/MT5Sl9h.png" alt="NORUS Logo" style="width: 150px;" /> | |
</a> | |
</div> | |
<h1>NORUS Tool</h1> | |
<p>Analyze your PDF and discover originality and similarity</p> | |
</header> | |
<main> | |
<form id="analysisForm" action="/validate" method="POST" enctype="multipart/form-data" onsubmit="startProgress()"> | |
<label for="analysis_type">Choose Analysis Type:</label> | |
<select name="analysis_type" id="analysis_type" required> | |
<option value="local">Local Directory</option> | |
<option value="pubmed">PubMed Search</option> | |
</select> | |
<div id="pubmed-options" style="display: none;"> | |
<label for="query">PubMed Query:</label> | |
<input type="text" name="query" id="query" /> | |
<label for="year_start">Start Year:</label> | |
<input type="number" name="year_start" id="year_start" min="1900" max="2025" value="2000" /> | |
<label for="year_end">End Year:</label> | |
<input type="number" name="year_end" id="year_end" min="1900" max="2025" value="2025" /> | |
<label for="num_articles">Number of Articles:</label> | |
<input type="number" name="num_articles" id="num_articles" min="1" value="10" /> | |
</div> | |
<div id="local-options" style="display: none;"> | |
<label for="comparison_files">Upload comparison PDFs:</label> | |
<input type="file" name="comparison_files" id="comparison_files" webkitdirectory multiple /> | |
</div> | |
<label for="pdf_file">Upload PDF:</label> | |
<input type="file" name="pdf_file" id="pdf_file" required /> | |
<button type="submit">Analyze</button> | |
</form> | |
<div id="progress-container" style="display: none;"> | |
<p style="text-align: center;">β³ Analysis in progress...</p> | |
<div id="progress-bar">0%</div> | |
</div> | |
{% if results %} | |
<section> | |
<h2>Analysis Results</h2> | |
<table> | |
<thead> | |
<tr> | |
<th>Title</th> | |
<th>Semantic Similarity (%)</th> | |
<th>Token Overlap (%)</th> | |
<th>OUI (Originality & Uniqueness Index)</th> | |
</tr> | |
</thead> | |
<tbody> | |
{% for result in results %} | |
<tr> | |
<td style="max-width: 400px; word-wrap: break-word;">{{ result.title }}</td> | |
<td>{{ "%.2f"|format(result.similarity) }}</td> | |
<td>{{ "%.2f"|format(result.token_overlap) }}</td> | |
<td>{{ "%.2f"|format(result.oui) }}</td> | |
</tr> | |
{% endfor %} | |
</tbody> | |
</table> | |
{% if keywords %} | |
<div class="results" style="text-align: center; margin-top: 30px;"> | |
<h3>π Common Keywords</h3> | |
<p> | |
{% for kw, count in keywords %} | |
<span style="margin: 5px; font-weight: bold;">{{ kw }} ({{ count }})</span> | |
{% endfor %} | |
</p> | |
</div> | |
{% endif %} | |
<form action="/download_report" method="post" style="text-align: center; margin-top: 30px;"> | |
<button type="submit">π Download PDF Report</button> | |
</form> | |
<div id="chart-container" style="margin-top: 50px;"> | |
<canvas id="similarityChart"></canvas> | |
</div> | |
</section> | |
{% endif %} | |
</main> | |
<footer><p>© 2025 NORUS Tool. All rights reserved.</p></footer> | |
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
const analysisType = document.getElementById("analysis_type"); | |
const pubmedOptions = document.getElementById("pubmed-options"); | |
const localOptions = document.getElementById("local-options"); | |
function toggleOptions() { | |
if (analysisType.value === "pubmed") { | |
pubmedOptions.style.display = "block"; | |
localOptions.style.display = "none"; | |
} else { | |
pubmedOptions.style.display = "none"; | |
localOptions.style.display = "block"; | |
} | |
} | |
analysisType.addEventListener("change", toggleOptions); | |
toggleOptions(); | |
}); | |
</script> | |
{% if results %} | |
<script> | |
</script> | |
{% endif %} | |
</body> | |
</html> | |