ConferenceCalls


#r "nuget: FSharp.Data"

#load "Common.fsx"

/// TranscriptParsing
type CallId =
    {
        Ticker : string 
        Exchange : string
        Date : System.DateTime
        FiscalQuarter : int     
    }

type EarningsCall = 
    {
        CallId : CallId
        Transcript : string [] 
    }

/// EarningsAnnouncementReturn
type Sentiment = 
    | Positive
    | Negative
    | Neutral

type EarningsAnnouncementReturn =
    {
        EarningsCall : EarningsCall
        TiingoObs : Common.Tiingo.TiingoObs []
        Sentiment : Sentiment option 
        Ear : float option 
    }

/// Multinomial Naive Bayes Classifier

/// Tokenizination
type Token = string
type Tokenizer = string -> Token []
type Document = Token []
type Class = 
    | Positive
    | Negative
    | Neutral
type LabelledDocument = Document * Class

/// Bag of Words 
type Count = int
type BagOfWords = (Token * Count) []
type LabelledBagOfWords = BagOfWords * Class

/// Naive Bayes Classifier
type NbClassifier = BagOfWords -> Class
type Prior = float
type Likelihood = float
type TokenLikelihoods = Map<Token, Likelihood>
type TokenScore = float
type DocumentScore = float

type Accuracy = float
type CallId = { Ticker: string Exchange: string Date: DateTime FiscalQuarter: int }
 TranscriptParsing
CallId.Ticker: string
Multiple items
val string : value:'T -> string
<summary>Converts the argument to a string using <c>ToString</c>.</summary>
<remarks>For standard integer and floating point values the and any type that implements <c>IFormattable</c><c>ToString</c> conversion uses <c>CultureInfo.InvariantCulture</c>. </remarks>
<param name="value">The input value.</param>
<returns>The converted string.</returns>


--------------------
type string = System.String
<summary>An abbreviation for the CLI type <see cref="T:System.String" />.</summary>
<category>Basic Types</category>
CallId.Exchange: string
CallId.Date: System.DateTime
namespace System
Multiple items
[<Struct>] type DateTime = new : year: int * month: int * day: int -> unit + 10 overloads member Add : value: TimeSpan -> DateTime member AddDays : value: float -> DateTime member AddHours : value: float -> DateTime member AddMilliseconds : value: float -> DateTime member AddMinutes : value: float -> DateTime member AddMonths : months: int -> DateTime member AddSeconds : value: float -> DateTime member AddTicks : value: int64 -> DateTime member AddYears : value: int -> DateTime ...
<summary>Represents an instant in time, typically expressed as a date and time of day.</summary>

--------------------
System.DateTime ()
   (+0 other overloads)
System.DateTime(ticks: int64) : System.DateTime
   (+0 other overloads)
System.DateTime(ticks: int64, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, calendar: System.Globalization.Calendar) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, calendar: System.Globalization.Calendar) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int) : System.DateTime
   (+0 other overloads)
System.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, kind: System.DateTimeKind) : System.DateTime
   (+0 other overloads)
CallId.FiscalQuarter: int
Multiple items
val int : value:'T -> int (requires member op_Explicit)
<summary>Converts the argument to signed 32-bit integer. This is a direct conversion for all primitive numeric types. For strings, the input is converted using <c>Int32.Parse()</c> with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.</summary>
<param name="value">The input value.</param>
<returns>The converted int</returns>


--------------------
[<Struct>] type int = int32
<summary>An abbreviation for the CLI type <see cref="T:System.Int32" />.</summary>
<category>Basic Types</category>


--------------------
type int<'Measure> = int
<summary>The type of 32-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to <see cref="T:System.Int32" />.</summary>
<category>Basic Types with Units of Measure</category>
type EarningsCall = { CallId: CallId Transcript: string [] }
Multiple items
EarningsCall.CallId: CallId

--------------------
type CallId = { Ticker: string Exchange: string Date: DateTime FiscalQuarter: int }
 TranscriptParsing
EarningsCall.Transcript: string []
type Sentiment = | Positive | Negative | Neutral
 EarningsAnnouncementReturn
union case Sentiment.Positive: Sentiment
union case Sentiment.Negative: Sentiment
union case Sentiment.Neutral: Sentiment
type EarningsAnnouncementReturn = { EarningsCall: EarningsCall TiingoObs: TiingoObs [] Sentiment: Sentiment option Ear: float option }
Multiple items
EarningsAnnouncementReturn.EarningsCall: EarningsCall

--------------------
type EarningsCall = { CallId: CallId Transcript: string [] }
EarningsAnnouncementReturn.TiingoObs: Common.Tiingo.TiingoObs []
module Common
module Tiingo from Common
type TiingoObs = { Date: DateTime Close: decimal High: decimal Low: decimal Open: decimal Volume: int AdjClose: decimal AdjHigh: decimal AdjLow: decimal AdjOpen: decimal ... }
Multiple items
EarningsAnnouncementReturn.Sentiment: Sentiment option

--------------------
type Sentiment = | Positive | Negative | Neutral
 EarningsAnnouncementReturn
type 'T option = Option<'T>
<summary>The type of optional values. When used from other CLI languages the empty option is the <c>null</c> value. </summary>
<remarks>Use the constructors <c>Some</c> and <c>None</c> to create values of this type. Use the values in the <c>Option</c> module to manipulate values of this type, or pattern match against the values directly. 'None' values will appear as the value <c>null</c> to other CLI languages. Instance methods on this type will appear as static methods to other CLI languages due to the use of <c>null</c> as a value representation.</remarks>
<category index="3">Options</category>
EarningsAnnouncementReturn.Ear: float option
Multiple items
val float : value:'T -> float (requires member op_Explicit)
<summary>Converts the argument to 64-bit float. This is a direct conversion for all primitive numeric types. For strings, the input is converted using <c>Double.Parse()</c> with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.</summary>
<param name="value">The input value.</param>
<returns>The converted float</returns>


--------------------
[<Struct>] type float = System.Double
<summary>An abbreviation for the CLI type <see cref="T:System.Double" />.</summary>
<category>Basic Types</category>


--------------------
type float<'Measure> = float
<summary>The type of double-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to <see cref="T:System.Double" />.</summary>
<category index="6">Basic Types with Units of Measure</category>
type Token = string
 Multinomial Naive Bayes Classifier
 Tokenizination
type Tokenizer = string -> Token []
type Document = Token []
Multiple items
type Class = | Positive | Negative | Neutral

--------------------
type ClassAttribute = inherit Attribute new : unit -> ClassAttribute
<summary>Adding this attribute to a type causes it to be represented using a CLI class.</summary>
<category>Attributes</category>


--------------------
new : unit -> ClassAttribute
union case Class.Positive: Class
union case Class.Negative: Class
union case Class.Neutral: Class
type LabelledDocument = Document * Class
[<Struct>] type Count = int
 Bag of Words
type BagOfWords = (Token * Count) []
type LabelledBagOfWords = BagOfWords * Class
type NbClassifier = BagOfWords -> Class
 Naive Bayes Classifier
[<Struct>] type Prior = float
[<Struct>] type Likelihood = float
type TokenLikelihoods = Map<Token,Likelihood>
Multiple items
module Map from Microsoft.FSharp.Collections
<summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.Map`2" />.</summary>

--------------------
type Map<'Key,'Value (requires comparison)> = interface IReadOnlyDictionary<'Key,'Value> interface IReadOnlyCollection<KeyValuePair<'Key,'Value>> interface IEnumerable interface IComparable interface IEnumerable<KeyValuePair<'Key,'Value>> interface ICollection<KeyValuePair<'Key,'Value>> interface IDictionary<'Key,'Value> new : elements:seq<'Key * 'Value> -> Map<'Key,'Value> member Add : key:'Key * value:'Value -> Map<'Key,'Value> member Change : key:'Key * f:('Value option -> 'Value option) -> Map<'Key,'Value> ...
<summary>Immutable maps based on binary trees, where keys are ordered by F# generic comparison. By default comparison is the F# structural comparison function or uses implementations of the IComparable interface on key values.</summary>
<remarks>See the <see cref="T:Microsoft.FSharp.Collections.MapModule" /> module for further operations on maps. All members of this class are thread-safe and may be used concurrently from multiple threads.</remarks>


--------------------
new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
[<Struct>] type TokenScore = float
[<Struct>] type DocumentScore = float
[<Struct>] type Accuracy = float