Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,11 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
|
| 3 |
+
```
|
| 4 |
+
██╗ ███████╗██╗ ██╗
|
| 5 |
+
██║ ██╔════╝╚██╗██╔╝
|
| 6 |
+
██║ █████╗ ╚███╔╝
|
| 7 |
+
██║ ██╔══╝ ██╔██╗
|
| 8 |
+
███████╗███████╗██╔╝ ██╗
|
| 9 |
+
╚══════╝╚══════╝╚═╝ ╚═╝
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
**Assistente Jurídico via MCP + Hugging Face Hub**
|
| 13 |
+
|
| 14 |
+
*Modelos NLP · Datasets de Jurisprudência · Inferência ao vivo*
|
| 15 |
+
|
| 16 |
+
[](https://python.org)
|
| 17 |
+
[](https://github.com/jlowin/fastmcp)
|
| 18 |
+
[](https://huggingface.co)
|
| 19 |
+
[](LICENSE)
|
| 20 |
+
|
| 21 |
+
</div>
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
## O que é
|
| 26 |
+
|
| 27 |
+
**LEX** é um servidor MCP especializado em domínio jurídico, construído sobre o Hugging Face Hub.
|
| 28 |
+
Ele expõe quatro ferramentas que qualquer LLM host compatível com MCP pode usar para:
|
| 29 |
+
|
| 30 |
+
- Descobrir modelos de NLP treinados em textos legais
|
| 31 |
+
- Explorar datasets de jurisprudência brasileira e internacional
|
| 32 |
+
- Rodar análise automática em textos jurídicos (resumo, NER, classificação)
|
| 33 |
+
- Pesquisar decisões judiciais por palavras-chave
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
Advogado / Sistema ──► Claude ──► LEX (MCP) ──► 🤗 Hugging Face Hub
|
| 37 |
+
↑ dados ao vivo
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
---
|
| 41 |
+
|
| 42 |
+
## Ferramentas
|
| 43 |
+
|
| 44 |
+
| Ferramenta | Função | Modelos / Datasets |
|
| 45 |
+
|---|---|---|
|
| 46 |
+
| `search_legal_models` | Busca modelos NLP jurídicos | Legal-BERT, Saul-7B, stjiris/bert-pt |
|
| 47 |
+
| `explore_legal_dataset` | Inspeciona datasets jurídicos | brazilian_court_decisions, lex_glue, CUAD |
|
| 48 |
+
| `analyze_legal_text` | Inferência NLP em texto legal | summarization, NER, classificação |
|
| 49 |
+
| `find_jurisprudence` | Busca em decisões por keyword | Corpus STF, TJSP, MultiLegalPile |
|
| 50 |
+
|
| 51 |
---
|
| 52 |
|
| 53 |
+
## Quickstart
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
git clone https://github.com/youruser/lex-mcp
|
| 57 |
+
cd lex-mcp
|
| 58 |
+
pip install -e .
|
| 59 |
+
export HF_TOKEN=hf_... # opcional mas recomendado
|
| 60 |
+
python server.py
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
### Claude Desktop
|
| 64 |
+
|
| 65 |
+
```json
|
| 66 |
+
{
|
| 67 |
+
"mcpServers": {
|
| 68 |
+
"lex-mcp": {
|
| 69 |
+
"command": "python",
|
| 70 |
+
"args": ["/caminho/absoluto/lex-mcp/server.py"],
|
| 71 |
+
"env": { "HF_TOKEN": "hf_..." }
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
### Interface Web
|
| 78 |
+
|
| 79 |
+
Abra `interface.html` no navegador para usar a interface visual dark com chat integrado.
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
|
| 83 |
+
## Exemplos de uso
|
| 84 |
+
|
| 85 |
+
> _"Quais são os melhores modelos BERT para classificação de petições em português?"_
|
| 86 |
+
|
| 87 |
+
> _"Explore o dataset `joelniklaus/brazilian_court_decisions` e mostre exemplos reais"_
|
| 88 |
+
|
| 89 |
+
> _"Analise este trecho e classifique a área do direito: 'rescisão contratual por inadimplemento...'"_
|
| 90 |
+
|
| 91 |
+
> _"Busque decisões sobre habeas corpus nos datasets de jurisprudência brasileira"_
|
| 92 |
+
|
| 93 |
+
---
|
| 94 |
+
|
| 95 |
+
## Estrutura
|
| 96 |
+
|
| 97 |
+
```
|
| 98 |
+
lex-mcp/
|
| 99 |
+
├── server.py # FastMCP server — 4 ferramentas jurídicas
|
| 100 |
+
├── interface.html # UI dark/terminal com chat e inferência ao vivo
|
| 101 |
+
├── pyproject.toml # dependências e build config
|
| 102 |
+
└── README.md # este arquivo
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
---
|
| 106 |
+
|
| 107 |
+
## License
|
| 108 |
+
|
| 109 |
+
Apache 2.0
|