Пример #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            txtAnalysis.AppendText("Searching for query: ");
            txtAnalysis.AppendText(txtQuery.Text);
            txtAnalysis.AppendText("\r\n\r\nResult:\r\n");

            current_query = new Query(999, txtQuery.Text);

            current_query.preprocessQuery();
            current_query.calculateTerms();

            txtAnalysis.AppendText(" -- OLD WEIGHT --\r\n");
            foreach (KeyValuePair<string, double> entry in current_query.terms)
            {
                txtAnalysis.AppendText(entry.Key + " --> " + entry.Value + "\r\n");
            }
            txtAnalysis.AppendText("     --------\r\n\r\n Retrive results:\r\n");

            retrive_current_query(false);
        }
Пример #2
0
        private void cmbQuery_SelectedIndexChanged(object sender, EventArgs e)
        {
            //MessageBox.Show(queries[cmbQuery.SelectedIndex].content);
            txtAnalysis.AppendText("Searching for query: ");
            txtAnalysis.AppendText(queries[cmbQuery.SelectedIndex].content);

            current_query = queries[cmbQuery.SelectedIndex];

            current_query.preprocessQuery();
            current_query.calculateTerms();
            int _query = cmbQuery.SelectedIndex + 1;

            txtAnalysis.AppendText("  Relevant Docs: \r\n");
            foreach (RelevantJudgement rel in relevant_judgement)
            {
                if (rel.queryNumber == _query)
                    txtAnalysis.AppendText("   - D" + rel.documentNumber + "\r\n");
            }

            txtAnalysis.AppendText("\r\n\r\nResult:\r\n");
            retrive_current_query(false);

            txtAnalysis.AppendText("---------------------------\r\n");
            txtAnalysis.AppendText("Recall = " + Retrival.calculateRecall(relevant_judgement, result, cmbQuery.SelectedIndex) + "\r\n");
            txtAnalysis.AppendText("Precision = " + Retrival.calculatePrecision(relevant_judgement, result, cmbQuery.SelectedIndex) + "\r\n");
            txtAnalysis.AppendText("NIAP = " + Retrival.calculateNIAP(relevant_judgement, this.result, cmbQuery.SelectedIndex) + "\r\n");
            txtAnalysis.AppendText("---------------------------\r\n");
        }