TeresaK commited on
Commit
db6fd64
·
verified ·
1 Parent(s): 5d4054c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -82
README.md CHANGED
@@ -1,82 +1,10 @@
1
- # INC Plastic Treaty App
2
-
3
- ## Set up Development
4
-
5
- ### Install poetry environment
6
-
7
- Please install [poetry]("https://python-poetry.org/docs/") first before executing the following commands
8
-
9
- ```bash
10
- poetry install
11
- ``````
12
-
13
- #### Install pre-commit hooks
14
-
15
- ```bash
16
- pre-commit install
17
- pre-commit
18
- ``````
19
-
20
-
21
- #### Start app
22
-
23
- - excute the following command with the respective version
24
-
25
- ```bash
26
- streamlit run src/app/v1/app.py
27
- ``````
28
-
29
- ## Data Overview
30
-
31
- - taxonomy_related data
32
- - ```data/authors_taxonomy.json```: raw countries taxonomy
33
- - ```data/draft_cat_taxonomy.json```: draft cat taxonomy.json
34
- - ```data/authors_filter.json```: processed taxonomy for frontend filtering
35
- - ```data/draftcat_taxonomy_filter.json```: processed taxonomy for frontend filtering
36
- - ```data/inc_df_v6_small.csv```: processed data of scraping
37
- - ```data/inc_df.csv```: data for document Storage
38
- - ```data/taxonomies.txt```: raw taxonomies collection
39
- - application related data
40
- - ```database/document_store.pkl```: Document Store
41
- - ```database/document_store.pkl```: Meta data of the document store with countries and draft labs as columns
42
-
43
- ## Code Structure
44
-
45
- ### Data Preprocessing
46
-
47
- - ```src/data_processing/document_store_data.py```: Generates the data for the document store with last processing steps
48
- - ```src/data_processing/get_meta_data_filter.py```: Generates the meta data from document store for the filtering in the frontend
49
- - ```src/data_processing/taxonomy_processing.py```: Transforms the taxonomies for the filters in the frontend.
50
-
51
- ### Frontend
52
-
53
- - ```src/app/```: versions of app
54
- - ```src/utils```: The utils folder contains functions used in the frontend application. Please check the imports to see which functions are used.
55
- - ```styles```: css styles for apps
56
- - ```.streamlit```: Basic Theme of Frontend
57
- - Some Settings and Changes related to the Spaces App have to be done directly in the respective Streamlit App.
58
-
59
- ### Backend
60
-
61
- - ```src/document_store/document_store.py```: Generates the document store
62
- - ```src/rag/pipeline.py```: RAG Pipeline
63
- - ```src/rag/prompt/prompt_template.yaml```: Prompt Template for RAG
64
-
65
- ## Changes Document Storage
66
-
67
- - **Step 1**: Delete the ```database/document_store.pkl``` and the ```database/meta_data.csv``` files or give them a new name if you want to keep them until a successful change of the document storage.
68
- - **Step 2**: Run the script ```data_processing/document_store_data.py```. This changes update the ```data/inc_df.csv``` data. If you need to make changes in the ```data/inc_df_small_v6.csv```, they have to made either manually or you have to implement a new script with the changes.
69
- - **Step 3***: Run the script ```data_processing/get_meta_data_filter.py```. This will save a new document store and the meta_data from the document store.
70
- - **Step 4**: If the changes affect also the taxonomy then you need to update the taxonomies as well. To do so, first update manually ```data/authors_taxonomy.json``` and ```data/draftcat_taxonomy.json```. Then run the script ```src/data_processing/taxonomy_processing.py```.
71
- - Frequent Bugs after changes of the data:
72
- - new country or draft lab category or changes in the naming. Solution: Check the taxonomy files and update the ```src/data_processing/taxonomy_processing.py```
73
- - countries with special characters. Solution: Check ```data/inc_df_small_v6.csv``` if the ```data_processing/document_store_data.py``` fails. Check the ```database/meta_data.py```if the frontend application fails after changes and the taxonomies + filters.
74
-
75
- ## Changes App
76
-
77
- - Please always check changes in the app locally before pushing to the respective Spaces App.
78
- - To check the Spaces App locally you can clone it like Git Repositories. Do avoid making changes directly in the interface of the Spaces App.
79
- - Also if you copy changes from git to Spaces only copy the files where you have made changes. You need to make some adjustment before you copy the files:
80
- - Please remove all OPENAI_KEYS from the app.py file and the the pipeline.py files.
81
- - Make sure you added the following at the ```OPENAI_API_KEY = os.environ.get("OPEN_API_KEY")``` in the pipeline.py file
82
- - Remove from app.py and pipeline.py ```src``` from imports. Otherwise you will get a ModuleNotFoundError.
 
1
+ ---
2
+ title: "NegotiateAI"
3
+ emoji: "🤖"
4
+ colorFrom: "blue"
5
+ colorTo: "green"
6
+ sdk: "gradio" # or "streamlit" if you are using Streamlit
7
+ sdk_version: "3.0.0" # Change this to the correct version of the SDK you are using
8
+ app_file: app.py # Change this to your app's main file (could be "streamlit_app.py" if you use Streamlit)
9
+ pinned: false
10
+ ---