Matteo Morini commited on
Process empty sector field
Browse files
app.py
CHANGED
|
@@ -38,6 +38,7 @@ art_descr = (
|
|
| 38 |
'<b>Input Fields:</b>'
|
| 39 |
'<ul>'
|
| 40 |
'<li>Keywords search: <i>Use industrial, geographical, asset class descriptors.</i></li>'
|
|
|
|
| 41 |
'<li>Relevance threshold: <i>Select top <b>x%</b> matched symbols.</i></li>'
|
| 42 |
'<li>Correlation threshold: <i>Restrict analysis to correlations at least <b>x</b> strong.</i></li>'
|
| 43 |
'<li>Cutoff point: <i>Select where to split the time series (before/after).</i></li>'
|
|
@@ -224,10 +225,13 @@ def _pipeline(
|
|
| 224 |
_log = []
|
| 225 |
RELEVANCE_QUANTILE = RELEVANCE_QUANTILE_100s * 0.01
|
| 226 |
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
|
|
|
|
|
|
|
|
|
| 231 |
tickers_desc['relevance'] = tickers_desc['keywords'].apply(
|
| 232 |
lambda k: textdistance.ratcliff_obershelp(k, filter_string)
|
| 233 |
)
|
|
|
|
| 38 |
'<b>Input Fields:</b>'
|
| 39 |
'<ul>'
|
| 40 |
'<li>Keywords search: <i>Use industrial, geographical, asset class descriptors.</i></li>'
|
| 41 |
+
'<li>Sector: <i>If populated, strictly stick to selected sector.</i></li>'
|
| 42 |
'<li>Relevance threshold: <i>Select top <b>x%</b> matched symbols.</i></li>'
|
| 43 |
'<li>Correlation threshold: <i>Restrict analysis to correlations at least <b>x</b> strong.</i></li>'
|
| 44 |
'<li>Cutoff point: <i>Select where to split the time series (before/after).</i></li>'
|
|
|
|
| 225 |
_log = []
|
| 226 |
RELEVANCE_QUANTILE = RELEVANCE_QUANTILE_100s * 0.01
|
| 227 |
|
| 228 |
+
if sector:
|
| 229 |
+
tickers_desc = tickers_desc_prefilter[
|
| 230 |
+
tickers_desc_prefilter['sector'] == sector
|
| 231 |
+
] # all sectors included
|
| 232 |
+
else:
|
| 233 |
+
tickers_desc = tickers_desc_prefilter
|
| 234 |
+
|
| 235 |
tickers_desc['relevance'] = tickers_desc['keywords'].apply(
|
| 236 |
lambda k: textdistance.ratcliff_obershelp(k, filter_string)
|
| 237 |
)
|