from langchain_core.documents import Document
text = """
Marie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who conducted pioneering research on radioactivity.
She was the first woman to win a Nobel Prize, the first person to win a Nobel Prize twice, and the only person to win a Nobel Prize in two scientific fields.
Her husband, Pierre Curie, was a co-winner of her first Nobel Prize, making them the first-ever married couple to win the Nobel Prize and launching the Curie family legacy of five Nobel Prizes.
She was, in 1906, the first woman to become a professor at the University of Paris.
"""
documents = [Document(page_content=text)]
graph_documents = llm_transformer.convert_to_graph_documents(documents)
print(f"Nodes:{graph_documents[0].nodes}")
print(f"Relationships:{graph_documents[0].relationships}")---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
8 """
9 documents = [Document(page_content=text)]
---> 10 graph_documents = llm_transformer.convert_to_graph_documents(documents)
11 print(f"Nodes:{graph_documents[0].nodes}")
12 print(f"Relationships:{graph_documents[0].relationships}")
2 frames
/usr/local/lib/python3.10/dist-packages/langchain_experimental/graph_transformers/llm.py in process_response(self, document)
593 nodes_set = set()
594 relationships = []
--> 595 parsed_json = self.json_repair.loads(raw_schema.content)
596 for rel in parsed_json:
597 # Nodes need to be deduplicated using a set
AttributeError: 'str' object has no attribute 'content'
text = """ Marie Curie, born in 1867, was a Polish and naturalised-French physicist and chemist who conducted pioneering research on radioactivity. She was the first woman to win a Nobel Prize, the first person to win a Nobel Prize twice, and the only person to win a Nobel Prize in two scientific fields. Her husband, Pierre Curie, was a co-winner of her first Nobel Prize, making them the first-ever married couple to win the Nobel Prize and launching the Curie family legacy of five Nobel Prizes. She was, in 1906, the first woman to become a professor at the University of Paris. """ documents = [Document(page_content=text)] graph_documents = llm_transformer.convert_to_graph_documents(documents) print(f"Nodes:{graph_documents[0].nodes}") print(f"Relationships:{graph_documents[0].relationships}")--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () 8 """ 9 documents = [Document(page_content=text)] ---> 10 graph_documents = llm_transformer.convert_to_graph_documents(documents) 11 print(f"Nodes:{graph_documents[0].nodes}") 12 print(f"Relationships:{graph_documents[0].relationships}")
2 frames /usr/local/lib/python3.10/dist-packages/langchain_experimental/graph_transformers/llm.py in process_response(self, document) 593 nodes_set = set() 594 relationships = [] --> 595 parsed_json = self.json_repair.loads(raw_schema.content) 596 for rel in parsed_json: 597 # Nodes need to be deduplicated using a set
AttributeError: 'str' object has no attribute 'content' [/code] Я использую среду Colab Notebooks, Llm использует API HuggingFaceH4/starchat2-15b-v0.1 Я нашел аналогичную проблему на GitHub --https://github.com/langchain-ai/langchain/issues/21482
Я пытаюсь преобразовать .docx в pdf, используя метод преобразования. Раньше это работало, но теперь я вижу ошибку в выводе. Пожалуйста, предложите
#Converting docx to pdf format
from docx2pdf import convert
Я получаю исключение недопустимого приведения каждый раз, когда использую Convert.ToInt32(byte[]), и мне интересно, делаю ли я что-то не так, или это что-то общеизвестное.
Почему byte[] не выдает ошибку компилятора, если в этом методе нет...
Я делаю песочницу(с песком) и наткнулся на ошибку в этой строке:
для зерна в песке: зерно.обновление() Переменная sand — это словарь, и я не знаю, что пошло не так. Если вам нужна дополнительная ясность, прокомментируйте. Полная программа:...
Недавно я попробовал свои силы в разработке веб-страниц и пытаюсь использовать веб-токены JSON. Я использую конечную точку ниже в качестве очень простого входа в систему. К сожалению, я получаю следующую ошибку:
AttributeError: 'str' object has no...