Skip to content

Commit 8c9032e

Browse files
committed
updated documentation and README.md
1 parent a513d6f commit 8c9032e

File tree

2 files changed

+69
-46
lines changed

2 files changed

+69
-46
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ To install the dependencies, run the following command:
2020
uv sync
2121
```
2222

23+
To bring a code to a single format:
24+
25+
```bash
26+
uvx ruff format
27+
```
28+
2329
### PyTorch version
2430

2531
PyTorch is default set to CPU distributive:

test2text/pages/documentation.py

Lines changed: 63 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,72 @@ def show_documentation():
77
88
## About the Application
99
10-
**Test2Text** is a tool for showing saved test cases, requirements, and annotations, as well as for generating reports and analyzing requirements coverage by tests.
11-
The application helps automate working with test requirements and provides a convenient interface for analyzing the relationships between test cases and requirements.
12-
13-
---
14-
15-
## Application Pages Overview
16-
17-
### :gray-badge[:material/info: About application]
18-
- **Description:** This page contains the user guide, a description of all pages, and instructions for working with the application.
19-
- **How to use:** Simply read the description to understand the purpose of the application.
20-
21-
### :gray-badge[:material/database_upload: Annotations]
22-
- **Description:** Work with annotations that link requirements and test cases.
23-
- **How to use:**
24-
- View existing annotations.
25-
- Add new annotations to link requirements and test cases.
10+
**Test2Text** is a tool for computing requirement's coverage by tests and generating relevant reports.
11+
The application provides a convenient interface for analysis the relationships between test cases and requirements.
12+
""")
13+
st.divider()
14+
st.markdown("""
15+
## HOW TO USE
2616
27-
### :gray-badge[:material/database_upload: Requirements]
28-
- **Description:** View selected requirements.
29-
- **How to use:**
30-
- Browse the list of requirements.
31-
- Add new requirements.
32-
- Link requirements with annotations and test cases.
17+
### Upload data
18+
Click :gray-badge[:material/database_upload: Annotations] or :gray-badge[:material/database_upload: Requirements] to upload annotations and requirements from CSV files to the app's database.
3319
34-
### :gray-badge[:material/publish: Reports]
35-
- **Description:** Generate reports on test cases, requirements, and their relationships.
36-
- **How to use:**
37-
- Select the desired report type (e.g., by test case or by requirement).
38-
- Use filters to refine the report.
39-
- Analyze selected requirements or test cases by showed and plotted distances.
40-
41-
### :gray-badge[:material/cached: Controls]
42-
- **Description:** Update distances by embeddings (vector representations) for intelligent matching of requirements and annotations.
43-
- **How to use:**
44-
- Enter a search query or embedding.
45-
- Get relevant results based on vector search.
20+
### Renew data
21+
Click :gray-badge[:material/cached: Controls] to transform missed and new texts into numeral vectors (embeddings).
22+
Update distances by embeddings for intelligent matching of requirements and annotations.
4623
47-
### :gray-badge[:material/dataset: Visualize vectors]
48-
- **Description:** Visualise distances by embeddings (vector representations) of requirements and annotations.
49-
- **How to use:**
50-
- Run script that will get all the data from database and will plot it to 2d and 3d graphics.
51-
---
52-
53-
## Usage Tips
24+
### Generate reports
25+
Click :gray-badge[:material/publish: Requirement's Report] or :gray-badge[:material/publish: Test cases Report] to make a report.
26+
Use filters to select desired information. Analyze selected requirements or test cases by showed and plotted distances
5427
55-
- Upload annotations and requirements to the app's database.
56-
- Link test cases with requirements via annotations for better coverage analysis.
57-
- Use filters and search for quick access to the information you need.
58-
- Regularly review reports to monitor the quality of your tests.
59-
- Refer to the "Documentation" page for help on using the application.
28+
### Visualize saved data
29+
Click :gray-badge[:material/dataset: Visualize vectors] to plot distances between vector representations of all requirements and annotations.
6030
6131
""")
32+
st.divider()
33+
st.markdown("""
34+
### Methodology
35+
The application use a pre-trained transformer model from the [sentence-transformers library](https://huggingface.co/sentence-transformers), specifically [nomic-ai/nomic-embed-text-v1](https://huggingface.co/nomic-ai/nomic-embed-text-v1), a model trained to produce high-quality vector embeddings for text.
36+
The model returns, for each input text, a high-dimensional NumPy array (vector) of floating point numbers (the embedding).
37+
This arrays give us a possibility to calculate Euclidian distances between test cases annotations and requirements to view how similar or dissimilar the two texts.
38+
""")
39+
40+
st.markdown("""
41+
#### Euclidean (L2) Distance Formula
42+
The Euclidean (L2) distance is a measure of the straight-line distance between two points (or vectors) in a multidimensional space.
43+
It is widely used to compute the similarity or dissimilarity between two vector representations, such as text embeddings.
44+
""")
45+
st.markdown("""
46+
Suppose we have two vectors:
47+
""")
48+
st.latex(r"""
49+
[ \mathbf{a} = [a_1, a_2, ..., a_n] ],
50+
""")
51+
st.latex(r"""
52+
[ \mathbf{b} = [b_1, b_2, ..., b_n] ]
53+
""")
54+
55+
st.markdown("""
56+
The L2 distance between **a** and **b** is calculated as:
57+
""")
58+
59+
st.latex(r"""
60+
[ L_2(\mathbf{a}, \mathbf{b}) = \sqrt{(a_1 - b_1)^2 + (a_2 - b_2)^2 + \cdots + (a_n - b_n)^2} ]
61+
""")
62+
63+
st.markdown("""
64+
Or, more compactly:
65+
""")
66+
67+
st.latex(r"""
68+
[ L_2(\mathbf{a}, \mathbf{b}) = \sqrt{\sum_{i=1}^n (a_i - b_i)^2} ]
69+
""")
70+
71+
st.markdown("""
72+
- A **smaller L2 distance** means the vectors are more similar.
73+
- A **larger L2 distance** indicates greater dissimilarity.
74+
""")
75+
76+
st.markdown("""
77+
This formula is commonly used for comparing the semantic similarity of embeddings generated from text using models like Sentence Transformers.
78+
""")

0 commit comments

Comments
 (0)