I hereby claim:
- I am lhr0909 on github.
- I am lhr0909 (https://keybase.io/lhr0909) on keybase.
- I have a public key ASBuOVwpHfFIg-c6qEl2uyn_ANt93FTFtv_XTVkSJ2bkeAo
To claim this, I am signing this object:
| import csv | |
| import json | |
| import datetime | |
| events = [] | |
| # Open the CSV | |
| with open("portable_user_history-2024-06-02-csv.csv", "r") as f: | |
| reader = csv.DictReader( | |
| f, |
| 📄 Document: 390ade4aa6f98236224082851331c670 | |
| ╭───────────┬──────────────────────────────────────────────────────────────────╮ | |
| │ Attribute │ Value │ | |
| ├───────────┼──────────────────────────────────────────────────────────────────┤ | |
| │ text │ Naw man │ | |
| │ embedding │ ▄▄▄ │ | |
| ╰───────────┴──────────────────────────────────────────────────────────────────╯ | |
| └── 🔶 Matches | |
| ├── 📄 Document: 626c8c7ed40279b4152aae627223e253 | |
| │ ╭───────────┬──────────────────────────────────────────────────────────────────╮ |
| from jina import Flow | |
| from docarray import DocumentArray, Document | |
| from executor import DIETClassifierExecutor | |
| f = Flow().add( | |
| uses='jinahub+docker://ConveRTFeaturizer/latest' | |
| ).add( | |
| uses=DIETClassifierExecutor, uses_with={ 'model_path': './lightning_logs/version_4/checkpoints/epoch=999-step=1000.ckpt' } | |
| ) |
| from typing import Any, Dict, List | |
| import yaml | |
| from pathlib import Path | |
| from jina import Executor, requests | |
| from docarray import DocumentArray, Document | |
| from docarray.score import NamedScore | |
| import torch | |
| import torch.nn.functional as F | |
| from diet_classifier.config import DIETClassifierConfig |
| nlu: | |
| - intent: greet | |
| examples: | |
| - Hello | |
| - Hi | |
| - Hey | |
| - intent: affirm | |
| examples: | |
| - "Yes" | |
| - "Yes, that's right" |
| from typing import Dict, Any, List | |
| from pathlib import Path | |
| import yaml | |
| import torch | |
| import pytorch_lightning as pl | |
| from torch.utils.data import DataLoader | |
| from jina import Flow | |
| from docarray import DocumentArray, Document | |
| from conversational_sentence_encoder.vectorizers import SentenceEncoder | |
| from jina import Executor, requests | |
| from docarray import DocumentArray | |
| class ConveRTFeaturizer(Executor): | |
| def __init__(self, multiple_contexts=False, **kwargs): | |
| super(ConveRTFeaturizer, self).__init__(**kwargs) | |
| self.sentence_encoder = SentenceEncoder(multiple_contexts=multiple_contexts) | |
| @requests |
| import torch | |
| from torch import optim, nn, Tensor | |
| import torch.nn.functional as F | |
| import pytorch_lightning as pl | |
| from .config import DIETClassifierConfig | |
| from .models import IntentClassifier | |
| class DIETClassifier(pl.LightningModule): | |
| def __init__(self, config: DIETClassifierConfig): |
| import torch | |
| from torch import nn, Tensor | |
| from .config import DIETClassifierConfig | |
| class IntentClassifier(nn.Module): | |
| def __init__(self, config: DIETClassifierConfig): | |
| super().__init__() | |
| # Rasa's embedding layer is actually a "dense embedding layer" which is just a Keras dense layer | |
| # equivalent to a PyTorch Linear layer. |
I hereby claim:
To claim this, I am signing this object: