Spaces:
Sleeping
Sleeping
James MacQuillan
commited on
Commit
·
ffb6bce
1
Parent(s):
6ac2591
push
Browse files- app.py +1 -1
- healthcheck.txt +79 -25
- investmentvaluation.txt +0 -0
app.py
CHANGED
|
@@ -117,7 +117,7 @@ def process_query(user_input, history):
|
|
| 117 |
# Step 3: Generate a response using the search results
|
| 118 |
response = client.chat_completion(
|
| 119 |
model="Qwen/Qwen2.5-72B-Instruct",
|
| 120 |
-
messages=[{"role": "user", "content": f"Using the search results: {search_results_str} and chat history {history}, answer the user's query '{user_input}' concisely, using numerical data if available. "}],
|
| 121 |
max_tokens=3000,
|
| 122 |
stream=True
|
| 123 |
)
|
|
|
|
| 117 |
# Step 3: Generate a response using the search results
|
| 118 |
response = client.chat_completion(
|
| 119 |
model="Qwen/Qwen2.5-72B-Instruct",
|
| 120 |
+
messages=[{"role": "user", "content": f"Using the search results: {search_results_str} and chat history {history}, answer the user's query '{user_input}' concisely, using numerical data if available. if they are just making conversation, respond normally, without the data "}],
|
| 121 |
max_tokens=3000,
|
| 122 |
stream=True
|
| 123 |
)
|
healthcheck.txt
CHANGED
|
@@ -1,23 +1,28 @@
|
|
| 1 |
Objective
|
| 2 |
-
This file outlines a structured approach to evaluate the financial health of a company using a set of key financial ratios and metrics. The model
|
| 3 |
|
| 4 |
Metrics and Ratios
|
| 5 |
1. Liquidity Ratios
|
| 6 |
Current Ratio = Current Assets / Current Liabilities
|
| 7 |
Interpretation: A ratio between 1.5 and 3.0 is generally considered healthy. Below 1 indicates potential liquidity issues, while above 3 could signal inefficient capital allocation.
|
|
|
|
| 8 |
Quick Ratio = (Current Assets - Inventory) / Current Liabilities
|
| 9 |
-
Interpretation: A ratio above 1 indicates that the company can cover short-term obligations without selling inventory,
|
|
|
|
| 10 |
Logic:
|
| 11 |
|
| 12 |
If Current Ratio < 1 or Quick Ratio < 0.8, mark as “Weak Liquidity.”
|
| 13 |
-
If Current Ratio is between 1.5 and 3
|
| 14 |
2. Profitability Ratios
|
| 15 |
Gross Profit Margin = (Revenue - Cost of Goods Sold) / Revenue
|
| 16 |
Interpretation: Indicates core profitability before operational expenses. Higher values signal cost efficiency.
|
|
|
|
| 17 |
Net Profit Margin = Net Income / Revenue
|
| 18 |
Interpretation: Represents final profitability after all expenses. Higher percentages generally indicate a profitable business.
|
|
|
|
| 19 |
Return on Assets (ROA) = Net Income / Total Assets
|
| 20 |
Interpretation: Shows how effectively assets generate profit, with values over 5% considered healthy.
|
|
|
|
| 21 |
Logic:
|
| 22 |
|
| 23 |
High margins and ROA (>5%) indicate strong profitability, labeled as “Strong Profitability.”
|
|
@@ -25,8 +30,10 @@ If either margin is consistently low (<5%) over recent periods, flag as “Profi
|
|
| 25 |
3. Leverage Ratios
|
| 26 |
Debt-to-Equity Ratio = Total Debt / Total Equity
|
| 27 |
Interpretation: A ratio below 2 is typically favorable, as it indicates less reliance on debt.
|
|
|
|
| 28 |
Interest Coverage Ratio = Earnings Before Interest & Taxes (EBIT) / Interest Expense
|
| 29 |
Interpretation: Values above 3 suggest that the company can comfortably pay its interest expenses.
|
|
|
|
| 30 |
Logic:
|
| 31 |
|
| 32 |
If Debt-to-Equity < 2 and Interest Coverage > 3, label as “Low Financial Risk.”
|
|
@@ -34,8 +41,10 @@ If Debt-to-Equity > 3 or Interest Coverage < 1.5, flag as “High Financial Risk
|
|
| 34 |
4. Efficiency Ratios
|
| 35 |
Asset Turnover Ratio = Revenue / Total Assets
|
| 36 |
Interpretation: High values indicate efficient asset utilization.
|
|
|
|
| 37 |
Inventory Turnover Ratio = Cost of Goods Sold / Average Inventory
|
| 38 |
Interpretation: High turnover rates indicate efficient inventory management.
|
|
|
|
| 39 |
Logic:
|
| 40 |
|
| 41 |
If Asset Turnover is above industry average and Inventory Turnover shows strong movement, mark as “Efficient Operations.”
|
|
@@ -43,25 +52,27 @@ Low turnover rates suggest operational inefficiencies, flagged as “Operational
|
|
| 43 |
5. Growth Ratios
|
| 44 |
Revenue Growth Rate (year-over-year or quarter-over-quarter)
|
| 45 |
Interpretation: Positive, sustainable growth indicates business expansion.
|
|
|
|
| 46 |
Earnings Per Share (EPS) Growth = (EPS in current period - EPS in prior period) / EPS in prior period
|
| 47 |
Interpretation: Consistent positive EPS growth implies profitability and investor confidence.
|
|
|
|
| 48 |
Logic:
|
| 49 |
|
| 50 |
Strong growth in Revenue and EPS indicates “Positive Growth,” while negative trends raise “Growth Concerns.”
|
| 51 |
Scoring Logic: QuantiNeuron Health Check Score
|
| 52 |
-
To derive a QuantiNeuron Health Check Score (1-10), assign weighted values to each category based on their contribution to financial health. This score is a weighted aggregate that emphasizes profitability and liquidity, followed by leverage, efficiency, and growth.
|
| 53 |
-
|
| 54 |
-
Step 1: Assign Ratings (1-5) for Each Metric
|
| 55 |
|
|
|
|
| 56 |
Based on each metric’s analysis, assign scores:
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
| 61 |
1 = Very Weak
|
| 62 |
Step 2: Weighted Category Score Calculation
|
| 63 |
-
|
| 64 |
-
Weight each category:
|
| 65 |
|
| 66 |
Profitability: 25%
|
| 67 |
Liquidity: 20%
|
|
@@ -72,15 +83,16 @@ Calculate weighted scores for each category:
|
|
| 72 |
|
| 73 |
Category Score
|
| 74 |
=
|
| 75 |
-
(
|
|
|
|
|
|
|
| 76 |
×
|
| 77 |
Weight
|
| 78 |
Category Score=(Category Rating)×Weight
|
| 79 |
Step 3: Aggregate for Final Score
|
| 80 |
-
|
| 81 |
Sum up the weighted scores to derive a total score out of 10.
|
| 82 |
-
Step 4: Determine Health Check Tier
|
| 83 |
|
|
|
|
| 84 |
Score 9-10: “Excellent Health” (Low risk, high profitability)
|
| 85 |
Score 7-8: “Good Health” (Generally strong but minor areas to improve)
|
| 86 |
Score 5-6: “Moderate Health” (Mixed performance; moderate risk)
|
|
@@ -96,19 +108,61 @@ Efficient operations,
|
|
| 96 |
Moderate growth,
|
| 97 |
The model might assign:
|
| 98 |
|
| 99 |
-
Liquidity =
|
| 100 |
-
Calculating:
|
| 101 |
|
| 102 |
-
Liquidity Score =
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
Output
|
| 110 |
-
|
| 111 |
|
| 112 |
A QuantiNeuron Health Check Score on a 1-10 scale.
|
| 113 |
A Health Summary, outlining strengths and weaknesses based on metrics.
|
| 114 |
-
A Recommendation
|
|
|
|
| 1 |
Objective
|
| 2 |
+
This file outlines a structured approach to evaluate the financial health of a company using a set of key financial ratios and metrics. The model analyzes these ratios, applies context-specific logic, and derives a health score on a scale from 1 to 10. This score—known as the QuantiNeuron Health Check Score—serves as a snapshot indicator of the company's current financial viability.
|
| 3 |
|
| 4 |
Metrics and Ratios
|
| 5 |
1. Liquidity Ratios
|
| 6 |
Current Ratio = Current Assets / Current Liabilities
|
| 7 |
Interpretation: A ratio between 1.5 and 3.0 is generally considered healthy. Below 1 indicates potential liquidity issues, while above 3 could signal inefficient capital allocation.
|
| 8 |
+
|
| 9 |
Quick Ratio = (Current Assets - Inventory) / Current Liabilities
|
| 10 |
+
Interpretation: A ratio above 1 indicates that the company can cover short-term obligations without selling inventory, suggesting robust liquidity.
|
| 11 |
+
|
| 12 |
Logic:
|
| 13 |
|
| 14 |
If Current Ratio < 1 or Quick Ratio < 0.8, mark as “Weak Liquidity.”
|
| 15 |
+
If Current Ratio is between 1.5 and 3 and Quick Ratio > 1, mark as “Healthy Liquidity.”
|
| 16 |
2. Profitability Ratios
|
| 17 |
Gross Profit Margin = (Revenue - Cost of Goods Sold) / Revenue
|
| 18 |
Interpretation: Indicates core profitability before operational expenses. Higher values signal cost efficiency.
|
| 19 |
+
|
| 20 |
Net Profit Margin = Net Income / Revenue
|
| 21 |
Interpretation: Represents final profitability after all expenses. Higher percentages generally indicate a profitable business.
|
| 22 |
+
|
| 23 |
Return on Assets (ROA) = Net Income / Total Assets
|
| 24 |
Interpretation: Shows how effectively assets generate profit, with values over 5% considered healthy.
|
| 25 |
+
|
| 26 |
Logic:
|
| 27 |
|
| 28 |
High margins and ROA (>5%) indicate strong profitability, labeled as “Strong Profitability.”
|
|
|
|
| 30 |
3. Leverage Ratios
|
| 31 |
Debt-to-Equity Ratio = Total Debt / Total Equity
|
| 32 |
Interpretation: A ratio below 2 is typically favorable, as it indicates less reliance on debt.
|
| 33 |
+
|
| 34 |
Interest Coverage Ratio = Earnings Before Interest & Taxes (EBIT) / Interest Expense
|
| 35 |
Interpretation: Values above 3 suggest that the company can comfortably pay its interest expenses.
|
| 36 |
+
|
| 37 |
Logic:
|
| 38 |
|
| 39 |
If Debt-to-Equity < 2 and Interest Coverage > 3, label as “Low Financial Risk.”
|
|
|
|
| 41 |
4. Efficiency Ratios
|
| 42 |
Asset Turnover Ratio = Revenue / Total Assets
|
| 43 |
Interpretation: High values indicate efficient asset utilization.
|
| 44 |
+
|
| 45 |
Inventory Turnover Ratio = Cost of Goods Sold / Average Inventory
|
| 46 |
Interpretation: High turnover rates indicate efficient inventory management.
|
| 47 |
+
|
| 48 |
Logic:
|
| 49 |
|
| 50 |
If Asset Turnover is above industry average and Inventory Turnover shows strong movement, mark as “Efficient Operations.”
|
|
|
|
| 52 |
5. Growth Ratios
|
| 53 |
Revenue Growth Rate (year-over-year or quarter-over-quarter)
|
| 54 |
Interpretation: Positive, sustainable growth indicates business expansion.
|
| 55 |
+
|
| 56 |
Earnings Per Share (EPS) Growth = (EPS in current period - EPS in prior period) / EPS in prior period
|
| 57 |
Interpretation: Consistent positive EPS growth implies profitability and investor confidence.
|
| 58 |
+
|
| 59 |
Logic:
|
| 60 |
|
| 61 |
Strong growth in Revenue and EPS indicates “Positive Growth,” while negative trends raise “Growth Concerns.”
|
| 62 |
Scoring Logic: QuantiNeuron Health Check Score
|
| 63 |
+
To derive a QuantiNeuron Health Check Score (1-10), we assign weighted values to each category based on their contribution to financial health. This score is a weighted aggregate that emphasizes profitability and liquidity, followed by leverage, efficiency, and growth.
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
Step 1: Assign Ratings (1-10) for Each Metric
|
| 66 |
Based on each metric’s analysis, assign scores:
|
| 67 |
+
|
| 68 |
+
10 = Very Strong
|
| 69 |
+
8-9 = Strong
|
| 70 |
+
6-7 = Above Average
|
| 71 |
+
4-5 = Average
|
| 72 |
+
2-3 = Below Average
|
| 73 |
1 = Very Weak
|
| 74 |
Step 2: Weighted Category Score Calculation
|
| 75 |
+
Apply weights to each category:
|
|
|
|
| 76 |
|
| 77 |
Profitability: 25%
|
| 78 |
Liquidity: 20%
|
|
|
|
| 83 |
|
| 84 |
Category Score
|
| 85 |
=
|
| 86 |
+
(
|
| 87 |
+
Category Rating
|
| 88 |
+
)
|
| 89 |
×
|
| 90 |
Weight
|
| 91 |
Category Score=(Category Rating)×Weight
|
| 92 |
Step 3: Aggregate for Final Score
|
|
|
|
| 93 |
Sum up the weighted scores to derive a total score out of 10.
|
|
|
|
| 94 |
|
| 95 |
+
Step 4: Determine Health Check Tier
|
| 96 |
Score 9-10: “Excellent Health” (Low risk, high profitability)
|
| 97 |
Score 7-8: “Good Health” (Generally strong but minor areas to improve)
|
| 98 |
Score 5-6: “Moderate Health” (Mixed performance; moderate risk)
|
|
|
|
| 108 |
Moderate growth,
|
| 109 |
The model might assign:
|
| 110 |
|
| 111 |
+
Liquidity = 7, Profitability = 9, Leverage = 4, Efficiency = 8, Growth = 6
|
| 112 |
+
Calculating weighted scores:
|
| 113 |
|
| 114 |
+
Liquidity Score =
|
| 115 |
+
7
|
| 116 |
+
×
|
| 117 |
+
0.2
|
| 118 |
+
=
|
| 119 |
+
1.4
|
| 120 |
+
7×0.2=1.4
|
| 121 |
+
Profitability Score =
|
| 122 |
+
9
|
| 123 |
+
×
|
| 124 |
+
0.25
|
| 125 |
+
=
|
| 126 |
+
2.25
|
| 127 |
+
9×0.25=2.25
|
| 128 |
+
Leverage Score =
|
| 129 |
+
4
|
| 130 |
+
×
|
| 131 |
+
0.2
|
| 132 |
+
=
|
| 133 |
+
0.8
|
| 134 |
+
4×0.2=0.8
|
| 135 |
+
Efficiency Score =
|
| 136 |
+
8
|
| 137 |
+
×
|
| 138 |
+
0.15
|
| 139 |
+
=
|
| 140 |
+
1.2
|
| 141 |
+
8×0.15=1.2
|
| 142 |
+
Growth Score =
|
| 143 |
+
6
|
| 144 |
+
×
|
| 145 |
+
0.2
|
| 146 |
+
=
|
| 147 |
+
1.2
|
| 148 |
+
6×0.2=1.2
|
| 149 |
+
Total Health Check Score =
|
| 150 |
+
1.4
|
| 151 |
+
+
|
| 152 |
+
2.25
|
| 153 |
+
+
|
| 154 |
+
0.8
|
| 155 |
+
+
|
| 156 |
+
1.2
|
| 157 |
+
+
|
| 158 |
+
1.2
|
| 159 |
+
=
|
| 160 |
+
6.85
|
| 161 |
+
1.4+2.25+0.8+1.2+1.2=6.85
|
| 162 |
|
| 163 |
Output
|
| 164 |
+
you will return:
|
| 165 |
|
| 166 |
A QuantiNeuron Health Check Score on a 1-10 scale.
|
| 167 |
A Health Summary, outlining strengths and weaknesses based on metrics.
|
| 168 |
+
A Recommendation Statement, if necessary, for areas needing attention.
|
investmentvaluation.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|