Implement feature extraction and inference enhancements, including async processing and MongoDB integration

This commit is contained in:
2026-01-30 14:43:30 +08:00
parent 3d78b88d47
commit 1bd4547b99
7 changed files with 166 additions and 3 deletions

24
main.py
View File

@@ -1,6 +1,24 @@
def main():
print("Hello from deal-classification!")
from feature_extraction import process_single
from inference import engine
from services.mongo import voice_collection
async def get_customer_record():
cursor = voice_collection.find({
"tag": "20分钟通话",
"matched_contacts": {
"$elemMatch": {
"wecom_id": {"$exists": True, "$ne": ""}
}
}
}).sort([('_id', -1)]).limit(24)
return await cursor.to_list(length=24)
async def main():
records = await get_customer_record()
for record in records:
print(record)
if __name__ == "__main__":
main()
import asyncio
asyncio.run(main())