---
title: MemLoc-4B
canonical_url: "https://www.modelscope.cn/models/soliton110/MemLoc-4B"
md_url: "https://www.modelscope.cn/models/soliton110/MemLoc-4B.md"
repository: soliton110/MemLoc-4B
chinese_name: MemLoc-4B
last_updated: 2026-08-25
license: "Apache License 2.0"
pipeline_tag: universal-information-extraction
tasks:
  - universal-information-extraction
model_type:
  - qwen3
architectures:
  - Qwen3ForCausalLM
parameters: 4.4B
tensor_type:
  - BF16
library_name:
  - safetensors
downloads: 49
stars: 0
---

# MemLoc-4B

> MemLoc-4B - soliton110 在 ModelScope 开源的模型。MemLoc-4B，用于 memory相关证据定位

soliton110/MemLoc-4B 是 ModelScope 魔搭社区上的 4.4B 参数universal-information-extraction模型，采用 Apache License 2.0 许可。

- **Repository**: soliton110/MemLoc-4B
- **License**: Apache License 2.0
- **Tasks**: universal-information-extraction
- **Parameters**: 4.4B
- **Downloads**: 49
- **Stars**: 0
- **Last updated**: 2026-08-25

Source: https://www.modelscope.cn/models/soliton110/MemLoc-4B

---

### 当前模型的贡献者未提供更加详细的模型介绍。模型文件和权重，可浏览“模型文件”页面获取。
#### 您可以通过如下git clone命令，或者ModelScope SDK来下载模型

SDK下载
```bash
#安装ModelScope
pip install modelscope
```
```python
#SDK模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('soliton110/MemLoc-4B')
```
Git下载
```
#Git模型下载
git clone https://www.modelscope.cn/soliton110/MemLoc-4B.git
```

# 流程
```markdown
Evid (Evidence Localization)

Given a question and a set of retrieved conversational memories,
Evid identifies the most relevant memory units that provide direct
evidence for answering the question.

Input:
  - Question
  - Retrieved conversational memories

Output:
  - Evidence IDs

Example:
  Question:
    What kind of food does the user prefer?

  Retrieved memories:
    [1] I usually prefer Japanese food, especially sushi.
    [2] That's great! Do you have a favorite sushi restaurant?
    [3] I went to an Italian restaurant yesterday.

  Evid:
    <id>[1]</id>
```

# 使用说明
```python

import re
from openai import OpenAI

# 初始化 Evid 模型
client = OpenAI(
    base_url="http://0.0.0.0:8080/v1",
    api_key="EMPTY"
)

model_name = "memloc"

# 构造问题
question = "What kind of food does the user prefer?"

# 构造候选记忆
retrieved_texts = """
[1] 2024-03-12 [user]: I usually prefer Japanese food, especially sushi.
[2] 2024-03-12 [assistant]: That's great! Do you have a favorite sushi restaurant?
[3] 2024-04-01 [user]: I went to an Italian restaurant yesterday.
[4] 2024-04-01 [assistant]: Did you enjoy the pasta?
"""

# 构造 Evid Prompt
prompt = f"""
Question: {question}

Retrieved memories:
{retrieved_texts}

Identify the most relevant sentences that provide evidence
for answering the question.

Output only the evidence IDs in the following format:
<id>[1,2]</id>
"""

# 调用 Evid
response = client.chat.completions.create(
    model=model_name,
    messages=[
        {"role": "user", "content": prompt}
    ],
    temperature=0,
    max_tokens=1024,
)

output = response.choices[0].message.content.strip()

# 解析 Evidence IDs
match = re.search(r"<id>(.*?)</id>", output, re.DOTALL)

if match:
    evidence_ids = [
        int(x)
        for x in re.findall(r"\d+", match.group(1))
    ]
else:
    evidence_ids = []

print(f"Evid output: {output}")
print(f"Evidence IDs: {evidence_ids}")
```

<p style="color: lightgrey;">如果您是本模型的贡献者，我们邀请您根据<a href="https://modelscope.cn/docs/ModelScope%E6%A8%A1%E5%9E%8B%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B%E6%A6%82%E8%A7%88" style="color: lightgrey; text-decoration: underline;">模型贡献文档</a>，及时完善模型卡片内容。</p>
