1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2025-07-23 17:19:47 +02:00
This commit is contained in:
Xuan Sang LE
2018-06-05 16:28:53 +02:00
parent 41d84a9c07
commit 31c371b2c1
7 changed files with 114 additions and 4 deletions

View File

@ -88,7 +88,8 @@ get.bytag = function(user, b64tag, limit, action, id)
return data, sort
end
get.analyse = function(user)
get.analyse = function(user, n)
if not n then n = 5 end
local path = "/home/mrsang/aiws/blog-clustering"
local gettext = loadfile(path.."/gettext.lua")()
local cluster = loadfile(path.."/cluster.lua")()
@ -111,7 +112,7 @@ get.analyse = function(user)
db:delete({["="] = {["1"] = 1}})
-- get similarity and put to the table
for id,v in pairs(vectors) do
local top = cluster.top_similarity(id,vectors,3)
local top = cluster.top_similarity(id,vectors,n)
for a,b in pairs(top) do
local record = {pid = id, sid = a, score = b}
db:insert(record)

View File

@ -533,4 +533,9 @@ afx-hbox.inputbox{
margin-left: 10px;
margin-right: 10px;
border-bottom: 1px solid #e5e5e5;
}
div[data-id="status"]{
padding-left: 10px;
padding-top:5px;
color:#724841;
}

View File

@ -87,10 +87,11 @@
<ul>
<li><i class = "fa fa-home"></i><a href="./">Home</a></li>
<li ><i class = "fa fa-address-card"></i><a href="https://info.lxsang.me" >Porfolio</a></li>
<li><i class = "fa fa-paper-plane"></i><a href="#" onclick="mailtoMe('rst')" >Contact</a></li>
<li><i class = "fa fa-envelope"></i><a href="#" onclick="mailtoMe('rst')" >Contact</a></li>
<?lua
if not HEADER.mobile then
?>
<li> <i class = "fa fa-paper-plane"></i><a href="#" onclick="subscribe('rst')">Subscribe</a></li>
<li > <i class = "fa fa-globe"></i><a href = "https://os.lxsang.me" target="_blank">AntOS</a></li>
<?lua end ?>
</ul>