Rename index.html to index.js
Browse files- index.html → index.js +1 -29
index.html → index.js
RENAMED
@@ -1,30 +1,4 @@
|
|
1 |
-
|
2 |
-
<!DOCTYPE html>
|
3 |
-
<html lang="en">
|
4 |
-
<head>
|
5 |
-
<meta charset="UTF-8">
|
6 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
-
<title>Transformer Sentiment Analyzer</title>
|
8 |
-
<link rel="stylesheet" href="style.css">
|
9 |
-
</head>
|
10 |
-
<body>
|
11 |
-
<header>
|
12 |
-
<h1>Transformer Sentiment Analyzer</h1>
|
13 |
-
</header>
|
14 |
-
<main class="container">
|
15 |
-
<form id="analyze-form">
|
16 |
-
<label for="inputText">Enter text to analyze:</label>
|
17 |
-
<textarea id="inputText" name="inputText" rows="4" placeholder="Type your text here..." required aria-required="true"></textarea>
|
18 |
-
<button type="submit" id="analyzeButton">Analyze Sentiment</button>
|
19 |
-
</form>
|
20 |
-
<section id="result" aria-live="polite"></section>
|
21 |
-
</main>
|
22 |
-
<script type="module" src="index.js"></script>
|
23 |
-
</body>
|
24 |
-
</html>
|
25 |
-
```
|
26 |
-
```javascript
|
27 |
-
// index.js
|
28 |
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers';
|
29 |
|
30 |
const analyzeForm = document.getElementById('analyze-form');
|
@@ -62,5 +36,3 @@ analyzeForm.addEventListener('submit', async (event) => {
|
|
62 |
analyzeButton.textContent = 'Analyze Sentiment';
|
63 |
analyzeButton.disabled = false;
|
64 |
});
|
65 |
-
|
66 |
-
initPipeline();
|
|
|
1 |
+
# index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers';
|
3 |
|
4 |
const analyzeForm = document.getElementById('analyze-form');
|
|
|
36 |
analyzeButton.textContent = 'Analyze Sentiment';
|
37 |
analyzeButton.disabled = false;
|
38 |
});
|
|
|
|