Pass DocumentChunk metadata_id to _metadata field
This commit is contained in:
parent
aacba555c9
commit
3d5cb7644a
1 changed files with 15 additions and 3 deletions
|
|
@ -34,7 +34,11 @@ class TextChunker():
|
||||||
word_count = chunk_data["word_count"],
|
word_count = chunk_data["word_count"],
|
||||||
is_part_of = self.document,
|
is_part_of = self.document,
|
||||||
chunk_index = self.chunk_index,
|
chunk_index = self.chunk_index,
|
||||||
cut_type = chunk_data["cut_type"]
|
cut_type = chunk_data["cut_type"],
|
||||||
|
_metadata = {
|
||||||
|
"index_fields": ["text"],
|
||||||
|
"metadata_id": self.document.metadata_id
|
||||||
|
}
|
||||||
)
|
)
|
||||||
paragraph_chunks = []
|
paragraph_chunks = []
|
||||||
self.chunk_size = 0
|
self.chunk_size = 0
|
||||||
|
|
@ -47,7 +51,11 @@ class TextChunker():
|
||||||
word_count = self.chunk_size,
|
word_count = self.chunk_size,
|
||||||
is_part_of = self.document,
|
is_part_of = self.document,
|
||||||
chunk_index = self.chunk_index,
|
chunk_index = self.chunk_index,
|
||||||
cut_type = paragraph_chunks[len(paragraph_chunks) - 1]["cut_type"]
|
cut_type = paragraph_chunks[len(paragraph_chunks) - 1]["cut_type"],
|
||||||
|
_metadata = {
|
||||||
|
"index_fields": ["text"],
|
||||||
|
"metadata_id": self.document.metadata_id
|
||||||
|
}
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
@ -64,7 +72,11 @@ class TextChunker():
|
||||||
word_count = self.chunk_size,
|
word_count = self.chunk_size,
|
||||||
is_part_of = self.document,
|
is_part_of = self.document,
|
||||||
chunk_index = self.chunk_index,
|
chunk_index = self.chunk_index,
|
||||||
cut_type = paragraph_chunks[len(paragraph_chunks) - 1]["cut_type"]
|
cut_type = paragraph_chunks[len(paragraph_chunks) - 1]["cut_type"],
|
||||||
|
_metadata = {
|
||||||
|
"index_fields": ["text"],
|
||||||
|
"metadata_id": self.document.metadata_id
|
||||||
|
}
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue