I would add a Sectors classifier to your pipeline. Then in your daily code, you can use some pandas code to average the momentum within each sector. You'll need the groupby feature of pandas.
Another way of achieving your idea is to look at the intersection of top 50% of stocks by absolute momentum intersected with top 50% momentum for their industry. You can use demean groupby sector for the latter.
Note, sectors have momentum in the short term, whereas individual stocks mean revert. Combining different time frames might be helpful. Short term for industries, longer term for stocks.