Skip to content

Commit dfd17af

Browse files
Merge pull request #8 from shcherbak-ai/dev
docs: serialization desc. update
2 parents 63905c2 + 443058e commit dfd17af

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

dev/usage_examples/docs/serialization/serialization.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,20 @@
6565
doc = llm.extract_all(doc)
6666

6767
# Serialize the LLM config, pipeline and document
68-
llm_config_json = llm.to_json() # or to_dict() / to_disc()
69-
document_pipeline_json = document_pipeline.to_json() # or to_dict() / to_disc()
70-
processed_doc_json = doc.to_json() # or to_dict() / to_disc()
68+
llm_config_json = llm.to_json() # or to_dict() / to_disk()
69+
document_pipeline_json = document_pipeline.to_json() # or to_dict() / to_disk()
70+
processed_doc_json = doc.to_json() # or to_dict() / to_disk()
7171

7272
# Deserialize the LLM config, pipeline and document
7373
llm_deserialized = DocumentLLM.from_json(
7474
llm_config_json
75-
) # or from_dict() / from_disc()
75+
) # or from_dict() / from_disk()
7676
document_pipeline_deserialized = DocumentPipeline.from_json(
7777
document_pipeline_json
78-
) # or from_dict() / from_disc()
78+
) # or from_dict() / from_disk()
7979
processed_doc_deserialized = Document.from_json(
8080
processed_doc_json
81-
) # or from_dict() / from_disc()
81+
) # or from_dict() / from_disk()
8282

8383
# All extracted data is preserved!
8484
assert processed_doc_deserialized.aspects[0].concepts[0].extracted_items

docs/docs-raw-for-llm.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4984,7 +4984,7 @@ Each object supports three serialization methods:
49844984
* "to_dict()" - Converts the object to a Python dictionary for in-
49854985
memory operations
49864986

4987-
* "to_disc(file_path)" - Saves the object directly to disk at the
4987+
* "to_disk(file_path)" - Saves the object directly to disk at the
49884988
specified path
49894989

49904990

@@ -4999,7 +4999,7 @@ corresponding class methods:
49994999
* "from_dict(dict_object)" - Creates an object from a Python
50005000
dictionary
50015001

5002-
* "from_disc(file_path)" - Loads an object from a file on disk
5002+
* "from_disk(file_path)" - Loads an object from a file on disk
50035003

50045004

50055005
📝 Example Usage
@@ -5072,20 +5072,20 @@ corresponding class methods:
50725072
doc = llm.extract_all(doc)
50735073

50745074
# Serialize the LLM config, pipeline and document
5075-
llm_config_json = llm.to_json() # or to_dict() / to_disc()
5076-
document_pipeline_json = document_pipeline.to_json() # or to_dict() / to_disc()
5077-
processed_doc_json = doc.to_json() # or to_dict() / to_disc()
5075+
llm_config_json = llm.to_json() # or to_dict() / to_disk()
5076+
document_pipeline_json = document_pipeline.to_json() # or to_dict() / to_disk()
5077+
processed_doc_json = doc.to_json() # or to_dict() / to_disk()
50785078

50795079
# Deserialize the LLM config, pipeline and document
50805080
llm_deserialized = DocumentLLM.from_json(
50815081
llm_config_json
5082-
) # or from_dict() / from_disc()
5082+
) # or from_dict() / from_disk()
50835083
document_pipeline_deserialized = DocumentPipeline.from_json(
50845084
document_pipeline_json
5085-
) # or from_dict() / from_disc()
5085+
) # or from_dict() / from_disk()
50865086
processed_doc_deserialized = Document.from_json(
50875087
processed_doc_json
5088-
) # or from_dict() / from_disc()
5088+
) # or from_dict() / from_disk()
50895089

50905090
# All extracted data is preserved!
50915091
assert processed_doc_deserialized.aspects[0].concepts[0].extracted_items

docs/source/serialization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Each object supports three serialization methods:
3535

3636
* ``to_json()`` - Converts the object to a JSON string for cross-platform compatibility
3737
* ``to_dict()`` - Converts the object to a Python dictionary for in-memory operations
38-
* ``to_disc(file_path)`` - Saves the object directly to disk at the specified path
38+
* ``to_disk(file_path)`` - Saves the object directly to disk at the specified path
3939

4040
🔄 Deserialization Methods
4141
---------------------------
@@ -44,7 +44,7 @@ To reconstruct objects from their serialized forms, use the corresponding class
4444

4545
* ``from_json(json_string)`` - Creates an object from a JSON string
4646
* ``from_dict(dict_object)`` - Creates an object from a Python dictionary
47-
* ``from_disc(file_path)`` - Loads an object from a file on disk
47+
* ``from_disk(file_path)`` - Loads an object from a file on disk
4848

4949
📝 Example Usage
5050
-----------------

0 commit comments

Comments
 (0)