back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/detectionalgorithm.h
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2025-08-03 02:28:24 +0300
committerscratko <m@scratko.xyz>2025-08-03 02:56:54 +0300
commitef8a3f6c3e20178ee520f1e6bedbc866e3c9b490 (patch)
treecbdea78c5c54e5dda4a8eb9c8a0d42091a27448c /detectionalgorithm.h
downloadartifical-text-detection-ef8a3f6c3e20178ee520f1e6bedbc866e3c9b490.tar.gz
artifical-text-detection-ef8a3f6c3e20178ee520f1e6bedbc866e3c9b490.tar.bz2
artifical-text-detection-ef8a3f6c3e20178ee520f1e6bedbc866e3c9b490.zip
Initial commit: added source code, resources and READMEHEADmaster
Diffstat (limited to 'detectionalgorithm.h')
-rwxr-xr-xdetectionalgorithm.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/detectionalgorithm.h b/detectionalgorithm.h
new file mode 100755
index 0000000..ac1ec58
--- /dev/null
+++ b/detectionalgorithm.h
@@ -0,0 +1,63 @@
+#ifndef DETECTIONALGORITHM_H
+#define DETECTIONALGORITHM_H
+#include <iostream>
+#include <fstream>
+#include <string>
+#include <vector>
+#include <algorithm>
+#include <map>
+#include <iterator>
+#include <QProgressDialog>
+#include <QObject>
+#include <sstream>
+#include <QFile>
+#include <QString>
+#include <QTextStream>
+#include <QApplication>
+#include <QCoreApplication>
+#include <QList>
+#include <QPointF>
+
+#define BOOST_LOCALE_HIDE_AUTO_PTR
+#define BOOST_BIND_NO_PLACEHOLDERS
+#pragma push_macro("slots")
+#undef slots
+#include <boost/python/numpy.hpp>
+#include <boost/python.hpp>
+#pragma pop_macro("slots")
+
+class DetectionAlgorithm : public QObject
+{
+ Q_OBJECT
+public:
+ //DetectionAlgorithm(int chunk_size = 1000, int n_gram = 5, const std::string& d = nullptr);
+ DetectionAlgorithm();
+ ~DetectionAlgorithm(){ }
+ void setOptions(int chunk = 1000, int n_g = 5, const std::string& d = nullptr, int select = 0);
+private:
+ const static int T = 10, NUMBER_OF_GROUPS = 10;
+ int chunk_size, n_gram;
+ std::string target_doc;
+ std::vector<std::string> robot_docs;
+ std::vector<int> robot_chunks_count;
+ int human_chunks_count;
+ std::vector<std::vector<std::string>> robot_chunks;
+ std::vector<std::string> human_chunks;
+ int total_robot_chunks;
+ std::vector <int> real_lable;
+ std::string doc;
+ std::vector<std::string> dictionary;
+ std::vector<std::vector<std::vector<int>>>freq_of_robot_ngramm;
+ std::vector<std::vector<int>>freq_of_human_ngramm;
+ std::vector<std::vector<double>> dzv;
+ int selection_alg;
+signals:
+ void value(int);
+ void run_chart(QList<QPointF>, QList<QPointF>, QList<QPointF>, QList<QPointF>);
+ void run_result(int, int);
+ void terminate();
+public slots:
+ void run_algorithm();
+};
+
+#endif // DETECTIONALGORITHM_H