-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (32 loc) · 1.62 KB
/
main.cpp
File metadata and controls
37 lines (32 loc) · 1.62 KB
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
#include "chunker/chunker.h"
namespace py = pybind11;
PYBIND11_MODULE(chunker_cpp, m)
{
m.doc() = "Advanced semantic text chunking library that preserves meaning and context";
py::class_<SemanticTextChunker>(m, "SemanticTextChunker")
.def(py::init<>())
.def("chunk_text_semantically", &SemanticTextChunker::chunk_text_semantically,
py::arg("text"),
py::arg("max_chunk_size") = 2000,
py::arg("min_chunk_size") = 500,
py::arg("min_coherence_threshold") = 0.3,
"Chunk text semantically while preserving meaning and context")
.def("get_chunk_details", &SemanticTextChunker::get_chunk_details,
py::arg("text"),
py::arg("max_chunk_size") = 2000,
py::arg("min_chunk_size") = 500,
py::arg("min_coherence_threshold") = 0.3,
"Get detailed information about each chunk including coherence scores and topics");
m.def("chunk_text_semantically", &chunk_text_semantically_standalone,
py::arg("text"),
py::arg("max_chunk_size") = 2000,
py::arg("min_chunk_size") = 500,
py::arg("min_coherence_threshold") = 0.3,
"Chunk text semantically while preserving meaning and context");
m.def("get_chunk_details", &get_chunk_details_standalone,
py::arg("text"),
py::arg("max_chunk_size") = 2000,
py::arg("min_chunk_size") = 500,
py::arg("min_coherence_threshold") = 0.3,
"Get detailed information about each chunk including coherence scores and topics");
}