File size: 4,275 Bytes
b16454e
04e306a
1921a14
b16454e
3036eab
b16454e
 
 
e00db83
b16454e
 
 
 
 
 
 
 
 
3036eab
2cd07d5
1921a14
 
 
 
b16454e
8f40cff
b16454e
 
 
 
 
 
 
 
 
 
 
1921a14
b16454e
 
 
1921a14
 
 
b16454e
 
8f40cff
b16454e
a447435
 
1921a14
 
b16454e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a447435
 
 
 
 
b16454e
 
 
 
 
 
 
 
 
a447435
b16454e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1921a14
be4bdc0
b16454e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import os
import src.web_crawler as web_crawler_utils
import src.weather as weather_utils

LOAD_FROM_EXISTING_INDEX_STORE = False
INDEX_TYPE = 'FAISS'

# Path from where to load the data (from the local directory)
DATA_PATH = './data/'

# Path to store the index/vector db
OUTPUT_PATH = os.path.join('./output/', INDEX_TYPE)
# Create OUTPUT_PATH directory if not present
if not os.path.exists(OUTPUT_PATH):
    os.makedirs(OUTPUT_PATH)

# Index categories (There would be an index for each category. On asking the query, App will search for the relevant docs/information only from the respective index category.)
INDEX_CATEGORY = [
    'crops',
    'fruits',
    'pest_management',
    'govt_policy',
    'insurance',
    'soil',
    'general',
    'vegetables'
]

# Doctype of the master index of each index category. Master index for each index category would be stored under this key.
INDEX_CATEGORY_MASTER_INDEX_DOC_TYPE = 'master'

# List of data sources/types & from where to load the data and create the index/vector store
# 2nd item is the type of source from where the data would be loaded. Currently it could come from either a file or URL.
DATA_SOURCES = {
    'PDF': 'pdf',
    'Text File': 'textfile',
    'Online PDF': 'online_pdf', # web_crawler_utils.get_ipm_packages_pdfs_urls()[:1]
    'URLs': 'urls',
}

# LangChain related constants
SIMILARITY_TOP_K = 1
MODE = 'embedding'
RESPONSE_MODE = 'default'
TEXT_SPLITTER_CHUNK_SIZE = 1000
TEXT_SPLITTER_CHUNK_OVERLAP = 0
TEXT_SPLITTER_SEPARATOR = '\n\n'


URLS = [
    # Govt. Schemes
    'https://agricoop.nic.in/en/Major#gsc.tab=0'
    'https://agricoop.nic.in/#gsc.tab=0',

    'https://dmi.gov.in/Documents/GrantCAGrapes.pdf',
    'https://dmi.gov.in/Documents/organicfaq.pdf',
    'https://dmi.gov.in/Documents/CAGMOrganic-III.pdf',
    'https://dmi.gov.in/GradesStandard.aspx',
    'https://www.india.gov.in/topics/agriculture',
    'https://www.india.gov.in/farmers-portal',
    
    # Pest Management related
    'https://niphm.gov.in/IPMPackages/Maize.pdf',

    # Banned Pesticides
    'https://ppqs.gov.in/divisions/cib-rc/registered-products',     # Online PDF links on the page
    
    # Mandi Price related
    'https://agmarknet.gov.in/',
    
    # General information related: Information of interests are present on the 2nd level url
    'https://www.manage.gov.in/nf/nf.asp',
    
    # Weather forecast related
    'https://nwp.imd.gov.in/blf/blf_temp/',   # need to select state -> district (on the new page) -> displays detailed table -> can get info at the block level as well from the same page on selection
    'https://nwp.imd.gov.in/blf/blf_temp/dis.php?value=12gujarat',   # to get weather forecast for the given state
    'https://nwp.imd.gov.in/blf/blf_temp/block.php?dis=12BHAVNAGAR',   # to get the weather forecast for the given district
]


# Supported Indian laguages for translating the English text to Indian language
INDIC_LANGUAGE = {
    'Hindi': 'hi',
    'Gujarati': 'gu',
    'Kannada': 'kn',
    'Marathi': 'mr',
    'Panjabi': 'pa',
    'Bengali': "bn",
    'Telugu': 'te',
    'Tamil': 'ta',
    'Malayalam': 'ml',
}

# State list used in the Mandi Price widget dropdown list
MANDI_PRICE_STATES = [
    'ANDAMAN AND NICOBAR ISLANDS',
    'ANDHRA PRADESH',
    'ASSAM',
    'BIHAR',
    'CHANDIGARH',
    'CHHATTISGARH',
    'GOA',
    'GUJARAT',
    'HARYANA',
    'HIMACHAL PRADESH',
    'JAMMU AND KASHMIR',
    'JHARKHAND',
    'KARNATAKA',
    'KERALA',
    'MADHYA PRADESH',
    'MAHARASHTRA',
    'NAGALAND',
    'ODISHA',
    'PUDUCHERRY',
    'PUNJAB',
    'RAJASTHAN',
    'TAMIL NADU',
    'TELANGANA',
    'TRIPURA',
    'UTTAR PRADESH',
    'UTTARAKHAND',
    'WEST BENGAL'
]

# State list used in the Weather forecast widget dropdown list
weather_utils_obj = weather_utils.WEATHER()
WEATHER_FORECAST_STATE_CODES = weather_utils_obj.get_state_names_codes()

# LIST OF  PESTICIDES WHICH ARE BANNED AND RESTRICTED USE (List created from: https://pib.gov.in/PressReleaseIframePage.aspx?PRID=1896140)
BANNED_PESTICIDES_FORMULATIONS = [
    'Alachlor',
    'Aldicarb',
    'Aldrin',
    'Benzene Hexachloride',
    'Benomyl',
    'Calcium Cyanide',
    'Carbaryl',
    'Chlorbenzilate',
    'Chlordane',
    'Chlorofenvinphos',
    'Copper Acetoarsenite',
]