aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gnqa.html
blob: 162f66f10364f4eff6c1b1c268ead9f7e72b367a (plain)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{% extends "base.html" %}
{% block title %}GNQA{% endblock %}

{% block css %}
<link rel="stylesheet" type="text/css" href="/static/new/css/llm.css">
<style>
 #loader {
     display: none;
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     width: 100%;
     background: rgba(0,0,0,0.75) url("/static/gif/loader.gif") no-repeat center center;
     z-index: 10000;
 }
 .gnqa-copy p {
     font-size: 16px;
     line-height: 1.5;
 }
 .search-hist-btn{
     padding:15px;

     margin: 0 auto;
     border-bottom: 1px solid #ccc;
 }
 .search-hist-btn a:hover {
     text-decoration: None;
     padding:5px;
     border-radius: 10px;
     color:blue;
     cursor:pointer;
 }
 .search-hist-btn a {
     font-weight: bold;
     color:#000;
 }
 #gnqna_search_home input{
     min-width: 25em;
 }
</style>
{% endblock %}

{% block search %}{% endblock %}

<div class="modal fade  bd-example-modal-lg " id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-lg" role="document" >
		<div class="modal-content">
                    <div class="modal-header">
			<h2 class="modal-title" id="exampleModalLabel">Your Search History</h2>

                    </div>
                    <div class="modal-body">
			<div>
                            {% if prev_queries %}
                            <div>
				{% for search in prev_queries[:8] %}
				<div class="search-hist-btn" style="display:flex;justify-content: space-between;align-items: center;">
                                    <form  class="search-hist-btn-form" method="GET" data-link="{{search}}">
					<a  class="search-hist-btn-link" data-link="{{search}}">{{search}}</a>
                                    </form>
				</div>
				{% endfor %}
                            </div>
                            {% endif %}
			</div>
                    </div>
                    <div class="modal-footer">
			<button type="button" class="btn btn-danger " style="color:white" >Delete All</button>
			<button type="button" class="btn btn-primary" data-dismiss="modal" style="color:white">Cancel</button>
                    </div>
		</div>
            </div>
</div>

{% block content %} <!-- Start of body -->
<section class="container-fluid">

    <div id="loader"></div>
    <div class="row">
	<h2 class="col-sm-12 text-center" style="font-variant:small-caps">Gnqa System</h2>
    </div>
    <form class="col-sm-12" id="gnqna_search_home" method="POST" action="/gnqna">
    <!--- init gnqa codebase here -->
    <!-- <div class="col-sm-1">
	 <button type="button" data-toggle="modal" data-target=".bd-example-modal-lg" class="btn btn-link btn-sm ">
         <i class="fa fa-history fa-2x" aria-hidden="true" title="Search History"></i>
	 </button>
	 </div> -->
    <div class="col-sm-6">
	<input class="text-center" id="gnqna_search_home_input" type="text" autocomplete="off"
               required placeholder="Ask More Questions or Topics (E.g Genes) " value='' name="querygnqa"/>
	<button type="button" data-toggle="modal" data-target=".bd-example-modal-lg" class="btn btn-primary btn-sm ">
            <i class="fa fa-search fa-2x" aria-hidden="true" title="Search History"></i>
	</button>
    </div>
    </form>
    <div class="row gnqa-copy">
	<p class="col-sm-11 col-md-offset-3 col-md-6">
	    Welcome to the GeneNetwork Question and Answer (GNQA)system. We utilize a large language model and 3000 scientific publications to make GNQA a subject matter expert in three areas: <b><a href="/">GeneNetwork.org </a></b>, <b>genomics/genetics with regards to diabetes</b> and <b>genomics/genetics with regards to agin.</b>.
	</p>
	<p class="col-sm-11 col-md-offset-3 col-md-6">At the moment when you ask GNQA something it will attempt to return a sensible answer with <q>real</q> references. To this end we aim to reduce hallucinations and provide a knowledge launchpad for a researcher to enhance their knowledge on the relevant subject matter.</p>
	<p class="col-sm-11 col-md-offset-3 col-md-6">
	    GNQA is not a finished product as we are working diligently to improve it daily.
	</p>
	<p class="col-sm-11 col-md-offset-3 col-md-6"><b>Thanks for using GNQA!</b> </p>

    </div>

</section>

{% endblock %}

{% block js %}
<script src="{{ url_for('js', filename='jquery/jquery.min.js') }}" type="text/javascript"></script>

<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='jquery-ui/jquery-ui.min.js') }}"></script>
<script type="text/javascript">
 document.addEventListener('DOMContentLoaded', function() {
     $("#btn-hist-gnqa").on("click",function() {
	 $("#exampleModal").modal("show")
     });

     $(".search-hist-btn-form").each(function(){
	 let item = $(this);
	 item.on("click", (e) => {
	     item.attr("action", `/gnqna/hist/search/${item.data("link")}`).submit();
	 })
     });
     $("#gnqna_search").keypress(function(event) {
	 if (event.keyCode === 13) {
	     $('#gnqna_form').submit();
	     let spinner = $("#loader")
	     spinner.show()
	 }
     });
     $('footer').hide()
     $("#gnqna_search_home_input").keypress(function(event) {
	 if (event.keyCode === 13) {
	     $('#gnqna_search_home').submit();
	     let spinner = $("#loader")
	     spinner.show();
	 }
     })
 });
</script>
{% endblock %}