Feedback with Reactive Patterns #1766
Replies: 5 comments
-
For discussion, another possibility for enabling consumers to provide feedback to producers: public interface IObservable<T, TFeedback>
{
public IDisposable Subscribe(IObserver<T, TFeedback> observer);
public void Feedback(IObserver<T, TFeedback> observer, T value, TFeedback feedback);
}
public interface IObserver<T, TFeedback>
{
public void OnCompleted(IObservable<T, TFeedback> source);
public void OnError(IObservable<T, TFeedback> source, Exception error);
public void OnNext(IObservable<T, TFeedback> source, T value);
} |
Beta Was this translation helpful? Give feedback.
-
There is a rule of thumb that a query on an |
Beta Was this translation helpful? Give feedback.
-
@quinmars, thank you for recommending DynamicData. It could be that other interfaces – existing or new – would be better suited for the specific use case's components – producers and consumers – in particular if adding feedback capabilities. |
Beta Was this translation helpful? Give feedback.
-
Sounds like a typical open-loop chain headed by a (synchronized) |
Beta Was this translation helpful? Give feedback.
-
Thanks @akarnokd. I'm interested in processing and streaming weighted sets of hypotheses, or components resembling If I understand correctly, you're indicating for the example use case: public interface IOnlineNaturalLanguageParser :
IObserver<IDictionary<string, float>>,
IObservable<IDictionary<IFormulaCollectionUpdate, float>> { } to extend another public interface IOnlineNaturalLanguageParser :
IObserver<IDictionary<string, float>>,
IObservable<IDictionary<IFormulaCollectionUpdate, float>>,
IObserver<Feedback> { } so that observers of the Is that what you meant by:
|
Beta Was this translation helpful? Give feedback.
-
Hello. I am interested in enabling consumers (
IObserver<*>
) to be able to provide "feedback" to producers (IObservable<*>
). I would like to share a preliminary approach to doing so and to welcome any ideas, comments, and suggestions.I'm looking at using mutable dictionaries (
IDictionary<*,*>
) with observables. A use case and example is that of enabling online natural language processing. The following example is drawn from a new project of mine: Nifty.In this example, each
IDictionary<string, float>
could be generated by a speech recognition component (which might implementIObservable<IDictionary<string, float>>
). The dictionary represents a set of district interpretative possibilities, e.g., for lexemes, with each interpretative possibility numerically weighted, or ranked, mapping to a scalar [0, 1]. In this example, anIFormulaCollectionUpdate
is an update, e.g., a "diff" or a "delta", to a set of formulas, or to a knowledgebase.I'm intentionally using
IDictionary<*,*>
instead ofIReadOnlyDictionary<*,*>
so that consumers could modify these dictionaries and so that producers could receive notifications as these modifications occur. I call this "feedback" when consumers, e.g.,IObserver<*>
, modify streaming mutable data instances through interfaces, e.g.,IDictionary<*, float>
, such that these modifications can be processed by producers, e.g.,IObservable<*>
. I'm interested in how "feedback" can enable adaptation and learning.Implementational possibilities include: (1) utilizing
INotifyCollectionChanged
with the dictionaries, (2) providing a set of callback methods to the dictionaries, e.g., in their constructors, such that these callbacks are invoked whenever the dictionaries are modified.With the natural language processing use cases in mind, a consumer might explore and compare semantic interpretations of natural language utterances using knowledgebases and provide "feedback" to natural language processing components in the form of adjusting the numerical weightings, or rankings, of interpretative hypotheses in the dictionaries. Consumers could, similarly, prune interpretive hypotheses, e.g., those resulting in a logical paradoxes, by removing key-value pairs from dictionaries.
I'm interested in bidirectional "feedback" with reactive streaming patterns, both in general and for the specific use case of online natural language processing. I'm also interested in exploring these ideas in distributed environments, e.g., exploring these ideas with Orleans.
Is using mutable interfaces, e.g.,
IDictionary<*,*>
, withIObserver<*>
andIObservable<*>
the best way to go to enable consumers to be able to provide "feedback" to producers both in general and for the specific use case? How would you go about enabling consumers to be able to provide "feedback" to producers? Thank you.Beta Was this translation helpful? Give feedback.
All reactions