generated from quillcraftsman/open-source-checklist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from findsimilar/core_features
find similar feature
- Loading branch information
Showing
15 changed files
with
343 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
""" | ||
Admin page for analysis | ||
""" | ||
# from django.contrib import admin | ||
from django.contrib import admin | ||
from django_find_similar.models import TextToken | ||
from django_find_similar.models.text import Token | ||
|
||
# Register your models here. | ||
admin.site.register(TextToken) | ||
admin.site.register(Token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% extends "base.html" %} | ||
{% block main %} | ||
<h2>{{object.name}}</h2> | ||
<p></p> | ||
<form method="post"> | ||
{% csrf_token %} | ||
{{form.as_p}} | ||
<button type="submit" class="btn btn-primary">Find Similar</button> | ||
</form> | ||
{% endblock %} | ||
{% block results %} | ||
{% with object.get_dataframe as data %} | ||
<table class="table"> | ||
<tr> | ||
{% for column in data.columns %} | ||
<th> | ||
{{column}} | ||
</th> | ||
{% endfor %} | ||
</tr> | ||
{% for index, row in data.iterrows %} | ||
<tr> | ||
{% for cell in row %} | ||
<td> | ||
{{cell}} | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% endwith %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{% extends "base.html" %} | ||
{% block main %} | ||
{% with object.text as text %} | ||
<table class="table border"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Value</th> | ||
</tr> | ||
<tr> | ||
<td> | ||
<b>Text</b> | ||
</td> | ||
<td> | ||
{{text.text}} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<b>Language</b> | ||
</td> | ||
<td> | ||
{{text.language}} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<b>Remove Stop Words</b> | ||
</td> | ||
<td> | ||
{{text.remove_stopwords}} | ||
</td> | ||
</tr> | ||
</table> | ||
{% endwith %} | ||
{% endblock %} | ||
{% block results %} | ||
|
||
{% with object.checkresultitem_set.all as items %} | ||
<table class="table table-striped"> | ||
<tr> | ||
<th>order</th> | ||
<th>text</th> | ||
<th>cos</th> | ||
<th>%</th> | ||
</tr> | ||
{% for item in items %} | ||
<tr> | ||
<td>{{item.order}}</td> | ||
<td>{{item.text.text}}</td> | ||
<td>{{item.cos}}</td> | ||
<td>{{item.cos_percent}}%</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
|
||
{% endwith %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{% extends "base.html" %} | ||
{% block main %} | ||
<h2>Results List</h2> | ||
{% endblock %} | ||
{% block results %} | ||
<table class="table"> | ||
<tr> | ||
<th>Text</th> | ||
<th>Language</th> | ||
<th>Remove Stop Words</th> | ||
<th>Created</th> | ||
<th>Detail</th> | ||
</tr> | ||
{% for result in object_list %} | ||
{% with result.text as text %} | ||
<tr> | ||
<td> | ||
<a href="{% url 'analysis:result' pk=result.pk %}"> | ||
{{text.text}} | ||
</a> | ||
</td> | ||
<td>{{text.language}}</td> | ||
<td>{{text.remove_stopwords}}</td> | ||
<td> | ||
{{result.create}} | ||
</td> | ||
<td> | ||
<a class="btn btn-info" href="{% url 'analysis:result' pk=result.pk %}"> | ||
Detail | ||
</a> | ||
</td> | ||
</tr> | ||
{% endwith %} | ||
{% endfor %} | ||
</table> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.