Find answers from the community

Updated 3 weeks ago

Metadata assignment in document object

Hello everyone! Did anyone encounter weird behavior from metadata assignment in Document object?

I am trying to pass 'appendix' key and a string value, which is a string of paths with a '';'' separator, but for some reason it does not work. For example I am essentially trying to do this:

'appendix': '\folder1\file1; \folder1\file2; \folder1\file3'

I did print out those strings and they do properly display.
W
i
18 comments
hey what error did you face?
no error, just empty appendix
lemme explain a bit more
Essentially I am trying to parse some html and xml files
and they have appendix files, some documents pdf, docx, whatever
and I am trying to get the path to those documents, and write it into metadata of the document (html or xml data)
I tried passing them to metadata as a list of strings, and as a single concatenated string
but it doesn't do anything
essentially:
Document(
text=text
metadata={
'appendix': path
}
)
then to check I do document.metadata['appendix']
it returns me either empty string or empty list
can you assign a list to it?
yep it should work
I will double check my code
Add a reply
Sign up and join the conversation on Discord