Skip to content

Commit 4b367b7

Browse files
New repository structure and refactoring (#17)
Renamed main directory, updated experiments workflow, refactored and cleaned up code
1 parent 8d07719 commit 4b367b7

File tree

230 files changed

+70126
-20007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+70126
-20007
lines changed

.github/workflows/metrics.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: codestyle
1+
name: tests
22

33
on:
44
push:
5-
branches:
6-
- dev
7-
- master
8-
- test/**
5+
branches: '**'
96
pull_request:
107
branches:
118
- dev
@@ -16,7 +13,7 @@ concurrency:
1613
cancel-in-progress: ${{ github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/master' }}
1714

1815
jobs:
19-
lint:
16+
test_ubuntu_latest:
2017
runs-on: ubuntu-latest
2118
steps:
2219
- uses: actions/checkout@v4
@@ -31,6 +28,6 @@ jobs:
3128
python -m pip install --upgrade pip poetry
3229
python -m poetry install --with tests --no-ansi --no-interaction
3330
34-
- name: run codestyle
31+
- name: run tests
3532
run: |
3633
python -m poetry run poe test

CONTRIBUTING.md

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to chatsky-llm-integration
22

3-
Thank you for your interest in contributing to the dff-llm-integration project! We welcome contributions from the community to help improve and expand this Chatsky LLM-Autoconfig tool.
3+
Thank you for your interest in contributing to the chatsky-llm-integration project! We welcome contributions from the community to help improve and expand this Chatsky LLM-Autoconfig tool.
44

55
## Getting Started
66

@@ -35,40 +35,18 @@ In order to update versions specified in poetry.lock, run
3535
poetry update
3636
```
3737

38-
## How to test your code
39-
40-
To test your algorithm or pipeline you need to follow these steps:
41-
42-
1. Decorate your class with AlgorithRegistry.register() like so:
43-
44-
```python
45-
from chatsky_llm_autoconfig.autometrics.registry import AlgorithmRegistry
46-
47-
@AlgorithmRegistry.register(input_type=BaseGraph, output_type=list[Dialogue])
48-
class DialogueSampler(DialogueGenerator)
49-
```
50-
51-
2. Make sure that `input_type` and `output_type` are matching with the signature of `.invoke()` method
52-
3. Run
53-
54-
```bash
55-
poetry run python dev_packages/chatsky_llm_autoconfig/chatsky_llm_autoconfig/autometrics/run_autometrics.py
56-
```
57-
58-
4. If metrics didn't drop then everything is fine. Add, commit and push as usual.
59-
6038
## How to Contribute
6139

6240
1. Make your changes and test hypothesis in the `./experiments` folder as it is described in **Conducting experiments** section
6341

64-
3. Ensure linting using commands as
42+
2. Ensure linting using commands as
6543

66-
```
67-
poetry run poe lint
68-
poetry run poe format
69-
```
44+
```bash
45+
poetry run poe lint
46+
poetry run poe format
47+
```
7048

71-
4. Create a pull request with clear description of fixed and features
49+
3. Create a pull request with clear description of fixes and features
7250

7351
## Pull Request format
7452

@@ -78,8 +56,17 @@ You can always create a draft PR and request review before you request to merge
7856
## Conducting experiments
7957

8058
Until any of the code make it way to the main repo it should be tested in `./experiments` folder.
81-
Each of the experiments must lay in the separate folder with name like `<YYYY.MM.DD>_<experiment_name>`.
82-
Inside of this directory must be a `report.md` file with results, metrics, future plans and other relevant information.
59+
Each of the experiments must lay in the separate folder with name like `exp<YYYY>_<MM>_<DD>_<hypothesis>`. Each experiment must be a poetry project that can be done via running either:
60+
61+
```bash
62+
poetry new --src <experiment_name>
63+
```
64+
65+
or, alternatively, if you've already created the folder
66+
67+
```bash
68+
poetry init
69+
```
8370
8471
**!!! Do not put images into the folder you are commiting, use GoogleDrive instead !!!**
8572
@@ -108,10 +95,9 @@ Supported types of graphs:
10895

10996
- [x] chain
11097
- [x] single cycle
98+
- [x] multi-cycle graph
99+
- [x] complex graph with cycles
111100

112101
Currently unsupported types:
113102

114103
- [ ] single node cycle
115-
- [ ] multi-cycle graph
116-
- [ ] incomplete graph
117-
- [ ] complex graph with cycles

README.md

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ poetry run python <your_file_name>.py
2525
## Contents
2626

2727
```
28-
./data - Examples, tests and other dialogue data in JSON format
2928
./experiments - Test field for experimental features, test data and results
3029
./scripts - Here we put scripts needed for `poethepoet` automation (you probably do not need to look inside)
31-
./dev_packages/chatsky_llm_autoconfig - Directory containing all the code for the `chatsky_llm_autoconfig` module
30+
./dialogue2graph - Directory containing all the code for the `dialogue2graph` module
3231
```
3332

3433
## Current progress
@@ -43,14 +42,15 @@ Supported types of graphs:
4342
Currently unsupported types:
4443

4544
- [ ] single node cycle
46-
- [ ] incomplete graph
4745

4846
## How to use
47+
4948
We provide several of using our library for various tasks.
49+
5050
### Data generation
5151

5252
```python
53-
from chatsky_llm_autoconfig.algorithms.cycle_graph_generation_pipeline import GraphGenerationPipeline
53+
from dialogue2graph.datasets.complex_dialogues.generation import LoopedGraphGenerator
5454
from langchain_openai import ChatOpenAI
5555

5656

@@ -67,10 +67,10 @@ validation_model = ChatOpenAI(
6767
base_url=os.getenv("OPENAI_BASE_URL"),
6868
temperature=0
6969

70-
pipeline = GraphGenerationPipeline(
71-
generation_model=generation_model,
72-
validation_model=validation_model
73-
)
70+
pipeline = LoopedGraphGenerator(
71+
generation_model=gen_model,
72+
validation_model=val_model,
73+
)
7474

7575
topics = [
7676
"technical support conversation",
@@ -83,9 +83,8 @@ topics = [
8383
successful_generations = []
8484

8585
for topic in topics:
86-
8786
try:
88-
result = pipeline(topic)
87+
result = pipeline(topic, use_cache=False)
8988

9089
# Check the result type
9190
if isinstance(result, GraphGenerationResult):
@@ -109,7 +108,7 @@ for topic in topics:
109108
### Dialogue sampling
110109

111110
```python
112-
from chatsky_llm_autoconfig.algorithms.dialogue_generation import RecursiveDialogueSampler
111+
from dialogue2graph.pipelines.core.dialogue_sampling import RecursiveDialogueSampler
113112
from chatsky_llm_autoconfig.graph import Graph
114113

115114
G = Graph(graph_dict={...})
@@ -119,26 +118,6 @@ sampler.invoke(graph=G) #-> list of Dialogue objects
119118

120119
```
121120

122-
### Graph generation
123-
### Evaluation
124-
125-
- Generate graph from scratch by topic (input: topic, output: graph) (for dataset generation)
126-
- algorithms.topic_graph_generation.CycleGraphGenerator
127-
128-
- change graph without changing graph structure (input: old graph + topic, output: new graph) (for dataset generation)
129-
130-
- sampling from dialogue graph (input: graph, output: dialogue) (for dataset generation)
131-
- algorithms.dialogue_generation.DialogueSampler
132-
133-
- augmentation of dialogue (input: dialogue, output: dialogue) (for dataset generation)
134-
- algorithms.dialogue_generation.DialogAugmentation
135-
136-
- generate graph from scratch by dialogue (input: dialogue, output: graph) (decisive algorithm)
137-
- GeneralGraphGenerator (experiments/2024.11.14_dialogue2graph)
138-
139-
- generate graph based on existing graph (input: old graph + dialog, output: new graph) (extended decision algorithm)
140-
- AppendChain (experiments/2024.11.17_concatenating_subchains_prompt)
141-
142121
## How to contribute?
143122

144123
You can find contribution guideline in [CONTRIBUTING.md](https://github.com/deeppavlov/chatsky-llm-autoconfig/blob/main/CONTRIBUTING.md)

data/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)