TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #65 · 8 апр.

Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex

Резултати

Пронајдени 3 слични објави

Пребарај: #mllm

当前筛选 #mllm清除筛选
GitHub Trends

@githubtrending · Post #15062 · 15.08.2025 г., 12:30

#python#mllm#point_clouds#scene_understanding#spatial_intelligence SpatialLM is a powerful 3D language model that turns complex 3D point cloud data from videos, RGBD images, or LiDAR into clear, structured 3D scene layouts showing walls, doors, windows, and objects with labels. It works without needing special equipment and can detect user-specified object categories. This helps you understand and analyze indoor spaces better, useful for robotics, navigation, and 3D design. You can run it on your data, visualize results, and even customize detection tasks easily, making 3D scene understanding more accessible and flexible for many applications. https://github.com/manycore-research/SpatialLM

GitHub Trends

@githubtrending · Post #15528 · 28.02.2026 г., 12:00

#python#agent#android#app#automation#copilot#gui#mllm#mobile#mobile_agents#multimodal#multimodal_agent#multimodal_large_language_models Mobile-Agent-v3.5 is Alibaba's top GUI agent family using GUI-Owl 1.5 models (2B to 235B sizes) for automating desktop, mobile, and browser tasks like stock checks, bookings, or document creation with planning, reflection, and memory. Try free online demos on ModelScope or Bailian, or use limited-time APIs—no setup needed. It leads 20+ benchmarks for real-world use. You benefit by saving time on repetitive tasks, boosting productivity, and handling complex operations hands-free across devices. https://github.com/X-PLUG/MobileAgent

GitHub Trends

@githubtrending · Post #14639 · 27.04.2025 г., 13:00

#python#agent_computer_interface#ai_agents#computer_automation#computer_use#grounding#gui_agents#in_context_reinforcement_learning#memory#mllm#planning#retrieval_augmented_generation Agent S2 is a smart AI assistant that handles computer tasks by breaking them into smaller steps and using specialized tools for each part, making it highly adaptable and efficient across different systems like Windows and Android. It outperforms other AI tools in completing complex tasks, learns from experience, and adjusts plans as needed, helping users automate digital work more reliably and effectively. https://github.com/simular-ai/Agent-S