-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_summarization.php
More file actions
132 lines (115 loc) · 4.01 KB
/
view_summarization.php
File metadata and controls
132 lines (115 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Text Summarization</title>
<link rel="icon" href="assets/img/logo_ipb.png">
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Text Summarization <small>Teks Berbahasa Indonesia</small></h1>
<p class="lead">Pembahasan dan hasil</p>
</div>
<h3>Statistik Dokumen </h3>
<div class="row">
<div class="col-md-4">
<p><strong> - Jumlah Kalimat : </strong><?= count($array_kalimat)?></p>
<p><strong> - Jumlah Kata : </strong><?= count($array_kata)?></p>
<p><strong> - Dirangkum menjadi : </strong><?= $kalimat_diambil ?> kalimat</p>
</div>
<div class="col-md-4">
<p><strong> - alfa : </strong><?= $alfa ?></p>
<p><strong> - beta : </strong><?= $beta ?></p>
</div>
</div>
<h3>Kalimat </h3>
<table class="table table-condensed table-striped" >
<?php for($i=0; $i<count($array_kalimat); $i++){ ?>
<tr>
<th width="10%">Kalimat <?= $i+1 ?> : </th>
<td><?= $array_kalimat[$i]?></td>
</tr>
<?php } ?>
</table>
<h3>Tokenisasi Kata </h3>
<table class="table table-condensed ">
<thead>
<tr>
<th>#</th>
<?php for($j=0; $j<count($array_kata); $j++){
echo "<th>" . $array_kata[$j] . "</th>";
}?>
</tr>
</thead>
<tbody>
<?php for($i=0; $i<count($array_kalimat); $i++){
echo "<tr>";
echo "<td>Kalimat ". ($i + 1) . "</td>";
for($j=0; $j<count($array_kata); $j++){
echo "<td>" . $frequency[$i][$j] . "</td>";
}
echo "</tr>";
}?>
<tr class="bg-info">
<td class="text-warning"><b>Sigma TF</b></td>
<?php for($j = 0; $j < count($tf); $j++){
echo "<td class='text-danger'><b>" . $tf[$j] . "</b></td>";
}?>
</tr>
<tr class="bg-info">
<td class="text-warning"><b>TF . IDF</b></td>
<?php for($j = 0; $j < count($tf); $j++){
echo "<td class='text-danger'><b>" . number_format($tf_idf[$j], 2, '.', '') . "</b></td>";
}?>
</tr>
</tbody>
</table>
<h3>Hasil Akhir</h3>
<table class="table table-condensed ">
<thead>
<tr>
<th>#</th>
<?php for($j=0; $j<count($array_kata); $j++){
echo "<th>" . $array_kata[$j] . "</th>";
}?>
<th class="bg-warning"><strong># Hasil</strong></th>
</tr>
</thead>
<tbody>
<?php for($i=0; $i<count($array_kalimat); $i++){
echo "<tr>";
echo "<td> Kalimat " . ($i +1) . "</td>";
for($j=0; $j<count($array_kata); $j++){
echo "<td>" . number_format($matriks_akhir[$i][$j] , 2, '.', '') . "</td>";
}
echo "<td class='bg-warning'>" . number_format($hasil_akhir[$i], 2, '.', ''). "</td>";
echo "</tr>";
} ?>
</tbody>
</table>
<h3>Rangkuman</h3>
<div class="well well-sm">
<p class="">
<?php
for($i=0; $i<count($array_kalimat); $i++){
if(in_array($i, $index_kalimat_terambil)){
echo $array_kalimat[$i] . ". ";
}
}
?>
</p>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="text-muted pull-right">Text Summarization, <a href="cs.ipb.ac.id">cs.ipb.ac.id</a> © <?= date("Y") ?></p>
</div>
</footer>
</body>
<script src="assets/js/jquery-2.1.1.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
</html>