langchain/libs/experimental/langchain_experimental/graph_transformers
Tomaz Bratanic d166967003
experimental: Add gliner graph transformer (#25066)
You can use this with:

```
from langchain_experimental.graph_transformers import GlinerGraphTransformer
gliner = GlinerGraphTransformer(allowed_nodes=["Person", "Organization", "Nobel"], allowed_relationships=["EMPLOYEE", "WON"])

from langchain_core.documents import Document

text = """
Marie Curie, 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)]

gliner.convert_to_graph_documents(documents)
```

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
2024-08-05 21:01:27 +00:00
..
__init__.py experimental: Add gliner graph transformer (#25066) 2024-08-05 21:01:27 +00:00
diffbot.py docs: fix kwargs docstring (#25010) 2024-08-02 19:54:54 -07:00
gliner.py experimental: Add gliner graph transformer (#25066) 2024-08-05 21:01:27 +00:00
llm.py docs: fix kwargs docstring (#25010) 2024-08-02 19:54:54 -07:00
relik.py Add relik transformer config (#25019) 2024-08-03 08:41:45 -04:00