KousarRaza commited on
Commit
ad8063a
·
verified ·
1 Parent(s): 13ec6b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -9
app.py CHANGED
@@ -5,15 +5,23 @@ from transformers import pipeline
5
  # Load the NLP model from Hugging Face
6
  nlp_model = pipeline('text-classification', model='distilbert-base-uncased')
7
 
8
- # Enhanced tree dataset with trees found in Pakistan
9
  data = {
10
- 'Tree': ['Neem', 'Peepal', 'Mango', 'Bamboo', 'Chili', 'Guava', 'Coconut', 'Papaya'],
11
- 'Climate': ['Tropical', 'Tropical', 'Tropical', 'Tropical', 'Tropical', 'Tropical', 'Tropical', 'Tropical'],
12
- 'Soil': ['Loamy', 'Sandy', 'Loamy', 'Loamy', 'Sandy', 'Loamy', 'Sandy', 'Loamy'],
13
- 'Use': ['Shade', 'Shade', 'Fruit', 'Construction', 'Spice', 'Fruit', 'Fruit', 'Fruit'],
14
- 'Height': ['Medium', 'Medium', 'Tall', 'Tall', 'Short', 'Medium', 'Tall', 'Medium'],
15
- 'Leaf Color': ['Green', 'Green', 'Green', 'Green', 'Green', 'Green', 'Green', 'Green'],
16
- 'Growth Rate': ['Fast', 'Fast', 'Fast', 'Fast', 'Medium', 'Fast', 'Fast', 'Fast']
 
 
 
 
 
 
 
 
17
  }
18
 
19
  # Convert to DataFrame
@@ -76,7 +84,15 @@ tree_images = {
76
  'Chili': 'https://upload.wikimedia.org/wikipedia/commons/f/fd/Chili_pepper_1.jpg',
77
  'Guava': 'https://upload.wikimedia.org/wikipedia/commons/7/7e/Guava_Fruit.jpg',
78
  'Coconut': 'https://upload.wikimedia.org/wikipedia/commons/7/7b/Coconut_%28fruit%29.jpg',
79
- 'Papaya': 'https://upload.wikimedia.org/wikipedia/commons/4/4e/Papaya_fruit.jpg'
 
 
 
 
 
 
 
 
80
  }
81
 
82
  # Dynamic sidebar content
 
5
  # Load the NLP model from Hugging Face
6
  nlp_model = pipeline('text-classification', model='distilbert-base-uncased')
7
 
8
+ # Enhanced tree dataset with more trees, climates, and soil types
9
  data = {
10
+ 'Tree': ['Neem', 'Peepal', 'Mango', 'Bamboo', 'Chili', 'Guava', 'Coconut', 'Papaya',
11
+ 'Pine', 'Oak', 'Acacia', 'Eucalyptus', 'Teak', 'Date Palm', 'Banana', 'Apple'],
12
+ 'Climate': ['Tropical', 'Tropical', 'Tropical', 'Tropical', 'Tropical', 'Tropical',
13
+ 'Tropical', 'Tropical', 'Temperate', 'Temperate', 'Arid', 'Temperate',
14
+ 'Tropical', 'Arid', 'Tropical', 'Temperate'],
15
+ 'Soil': ['Loamy', 'Sandy', 'Loamy', 'Loamy', 'Sandy', 'Loamy', 'Sandy', 'Loamy',
16
+ 'Loamy', 'Clay', 'Sandy', 'Sandy', 'Loamy', 'Sandy', 'Loamy', 'Loamy'],
17
+ 'Use': ['Shade', 'Shade', 'Fruit', 'Construction', 'Spice', 'Fruit', 'Fruit', 'Fruit',
18
+ 'Timber', 'Timber', 'Shade', 'Timber', 'Timber', 'Fruit', 'Fruit', 'Fruit'],
19
+ 'Height': ['Medium', 'Medium', 'Tall', 'Tall', 'Short', 'Medium', 'Tall', 'Medium',
20
+ 'Tall', 'Tall', 'Medium', 'Tall', 'Tall', 'Tall', 'Medium', 'Medium'],
21
+ 'Leaf Color': ['Green', 'Green', 'Green', 'Green', 'Green', 'Green', 'Green', 'Green',
22
+ 'Green', 'Green', 'Green', 'Green', 'Green', 'Green', 'Green', 'Green'],
23
+ 'Growth Rate': ['Fast', 'Fast', 'Fast', 'Fast', 'Medium', 'Fast', 'Fast', 'Fast',
24
+ 'Slow', 'Slow', 'Medium', 'Fast', 'Medium', 'Slow', 'Fast', 'Medium']
25
  }
26
 
27
  # Convert to DataFrame
 
84
  'Chili': 'https://upload.wikimedia.org/wikipedia/commons/f/fd/Chili_pepper_1.jpg',
85
  'Guava': 'https://upload.wikimedia.org/wikipedia/commons/7/7e/Guava_Fruit.jpg',
86
  'Coconut': 'https://upload.wikimedia.org/wikipedia/commons/7/7b/Coconut_%28fruit%29.jpg',
87
+ 'Papaya': 'https://upload.wikimedia.org/wikipedia/commons/4/4e/Papaya_fruit.jpg',
88
+ 'Pine': 'https://upload.wikimedia.org/wikipedia/commons/5/55/Pine_forest.JPG',
89
+ 'Oak': 'https://upload.wikimedia.org/wikipedia/commons/5/58/Oak_tree.jpg',
90
+ 'Acacia': 'https://upload.wikimedia.org/wikipedia/commons/8/8d/Acacia_tree.jpg',
91
+ 'Eucalyptus': 'https://upload.wikimedia.org/wikipedia/commons/3/38/Eucalyptus_tree.JPG',
92
+ 'Teak': 'https://upload.wikimedia.org/wikipedia/commons/1/1a/Teak_Tree.jpg',
93
+ 'Date Palm': 'https://upload.wikimedia.org/wikipedia/commons/a/ab/Date_Palm.JPG',
94
+ 'Banana': 'https://upload.wikimedia.org/wikipedia/commons/4/42/Banana_Tree.JPG',
95
+ 'Apple': 'https://upload.wikimedia.org/wikipedia/commons/1/15/Apple_Tree.jpg'
96
  }
97
 
98
  # Dynamic sidebar content