Implement feature extraction and inference enhancements, including async processing and MongoDB integration
This commit is contained in:
24
main.py
24
main.py
@@ -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())
|
||||
Reference in New Issue
Block a user