PesaQ-api / index.html
kamau1's picture
Update index.html
411409c
raw
history blame
1.43 kB
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Sema Translator</title>
<link rel="stylesheet" href="style.css" />
<py-script src="app.py"></py-script>
</head>
<body>
<div class="Header">
<h1>Sema Translator</h1>
<p>Unlock the Power of Global Communication with Sema Translator! Seamlessly bridging language barriers. With support for over 200 languages, Sema Translator opens up a realm of possibilities for building truly global applications.</p>
</div>
<div class="LanguageDropdown">
<h2>Select a Language:</h2>
<select id="languageSelect">
<!-- Add options dynamically -->
</select>
</div>
<div class="instructions">
<p>Use the following python code to access the api endpoint</p>
<pre style="text-align: left;">
import requests
url = "{public_url}/translate/"
data = {
"userinput": "rũcinĩ rwega, niwokĩra wega?",
"target_lang": "eng_Latn",
}
response = requests.post(url, json=data)
result = response.json()
print(result)
source_language = result['source_language']
print("Source Language:", source_language)
translation = result['translated_text']
print("Translated text:", translation)
</pre>
</div>
<div class="footer">
<h1>Created by Lewis Kamau Kiamru</h1>
</div>
</body>
</html>